Can a single WCF Service endpoint be set up to authenticate against multiple Authentication stores? i.e. if UserName and Password supplied check Custom DB, otherwise try Windows Auth.
Background:
I have WCF Service A which is injected with a client proxy to WCF Service B. Service B could have a dependency on Service C etc.
A User request to Service A comes in and is authenticated using a custom UserNamePasswordValidator
, and a ClaimSet
is built using a custom implementation of IAuthorizationPolicy.
The authentication succeeds and the service operation on A is invoked. This operation makes a call to Service B via the injected proxy.
The Service B request then goes through the Auth/Authz stack but fails because no credentials have been set. As Service A called Service B I trust it so want the authorization to succeed without having to pass around the User Name and Password of the original caller.
However it is possible that Service B can be called directly by a User with a username and password, so it must support both methods of authentication.