Switching between WCF windows authentication and basic authentication
I have an application where it should be possible to choose whether you want to use the built in securit开发者_StackOverflow中文版y (basic username and password) or the windows authentication. How do i make this possible for my application? different endpoints for each type?
I concur with your suggestion: the service should expose different endpoints for each authentication type, and the client will programaticaly select the appropriate endpoint.
The authentication type is a property of the Transport or Message security (depending upon which mode you are using), and the security settings are a property of the binding configuration.
So you would need to create two separate binding configurations. Then you would create two separate endpoints, each endpoint referencing a different binding configuration.
精彩评论