I have created my own MyHmacAuthProvider
that derives from AuthProvider
and implements IAuthWithRequest
.
I now only want to apply this provider to one of the operations one of many services (and not apply it to any other services or operations).
I am using this syntax right now on my operation:
internal class MyService : Service
{
[Authenticate(MyHmacAuthProvider.Name)]
public MyResponseDto Any(MyRequestDto body)
{
// Do Stuff here...
}
}
What I want to know is how to register this MyHmacAuthProvider
in the AppHost, so it does not get applied to any other operation except the one I am showing here?
(I already tried adding it to the collection of AuthProvider[]
in the AuthFeature
but that applies it to all operations of all services. I obviously don’t want that)