I have written an IIS module (base IHttpModule) that does some custom (OpenAuth) authentication before preceding to my WCF REST service.
I have extended GenericPrincipal to track my user, with an IIdentity, and set
the context.User field to my new principal:
application.context.User = principal
However, when I receive the context in WCF (next step down the pipeline), the User shows up as a "default" unauthenticated WindowsPrincipal (not the GenericPrincipal that i set).
I see lots of stuff on the net about making this work (including aspNetCompatibilityEnabled="true" for serviceHostingEnvironment, playing with OperationContext, etc...) But nothing I have tried seems to work.
Two questions:
- Is there a way to get this to work (or am I just barking up the wrong tree here).
- What would be the canonical way to do this, or maybe the more "WCF" way to handle this custom authentication.
Thanks