Last post Jan 01, 2016 08:52 AM by Weibo Zhang
Dec 31, 2015 03:45 PM|BitShift|LINK
Lets say I make a custom Authorization filter and want to use parameters eg. [MyCustomAuthCheck("test_value")], where are the value(s) stored?
How do I get "test_value" within the filter itself? The OnAuthorization method takes a AuthorizationContext
Jan 01, 2016 08:52 AM|Weibo Zhang|LINK
You could first create private property to store the value. In the constructor of you custom filter “MyCustomAuthCheck”, you could pass the value of “test_value” to the private property and then you could access this property in the method “OnAuthorization”.
For more things, you could have a look at the following link which provides a detailed demo to explain this method.