Within my custom authorization attribute code I would like to identify which WebAPI method has been called.
I appreciate that I could do this by passing the name in (see example 2) but I would rather not have to do this.
// Example1
[CustomAuthAttribute]
public MyResponse get(string param1, string param2)
{
...
}
// in the prev example I would like to be able to identify the
// method from within the CustomAuthAttribute code
// Example2
[CustomAuthAttribute(MethodName = "mycontroller/get")]
public MyResponse get(string param1, string param2)
{
...
}
// in this example I pass the controller/method names to the
// CustomAuthAttribute code
Is there a way I can somehow pick this up?