![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Username and Password Hi I have a very basic WCF service over basicHttpBinding with SSL. I can send a request and have the service send back the response - that works. I need to send with the request a user name and password. In the proxy code if I the following: using (MessageProcessor messageProcessor = new MessageProcessor()) { messageProcessor.Credentials = new NetworkCredential("hello", "world"); messageProcessor.ProcessMessage("tester"); } I'm having troubles pulling out the credentials information in the service method (ProcessMessage). Any ideas? Craig |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Username and Password What security mode does this use? I don't know if it is the same, but for TransportWithMessageCredential I use following: Under WCF, there should be a ClientCredentials.UserName property [denotes the security-mode], with subproperties of UserName and Password. The WCF service will need to designate a UserNamePasswordValidator (verifies passwords) and possibly an IAuthorizationPolicy (provides role membership information). In configuration, you'll need something like: <security mode="TransportWithMessageCredential"> <transport clientCredentialType="None"/> <message clientCredentialType="UserName" negotiateServiceCredential="false" establishSecurityContext="false"/> </security> <!--snip--> <serviceCredentials> <userNameAuthentication userNamePasswordValidationMode="Custom" cacheLogonTokens="true" customUserNamePasswordValidatorType="MyValidatorClass, MyValidatorAssembly [long version]"/> <windowsAuthentication allowAnonymousLogons="false"/> </serviceCredentials> <serviceAuthorization impersonateCallerForAllOperations="false" principalPermissionMode="Custom"> <authorizationPolicies> <add policyType="MyPolicyClass, MyPolicyAssembly [long version]" /> </authorizationPolicies> </serviceAuthorization> The validator would look something like: internal sealed class TokenValidator : UserNamePasswordValidator { public override void Validate(string userName, string password) { ... } } Any use? Marc |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Username and Password Hi Marc Thanks for the reply. This was my configuration on the server-side: <bindings> <basicHttpBinding> <binding name="basicHttpBindingConfiguration"> <security mode="Transport"> <transport clientCredentialType="Basic"/> </security> </binding> </basicHttpBinding> </bindings> My client is not a WCF client and will use the WSDL of the service. I have yet to find an example of https and custom user name password credentials for a non-WCF client. If you have one I'd be most gratful. Craig "Marc Gravell" wrote: > What security mode does this use? > > I don't know if it is the same, but for TransportWithMessageCredential > I use following: > > Under WCF, there should be a ClientCredentials.UserName property > [denotes the security-mode], with subproperties of UserName and > Password. > > The WCF service will need to designate a UserNamePasswordValidator > (verifies passwords) and possibly an IAuthorizationPolicy (provides > role membership information). > > In configuration, you'll need something like: > > <security mode="TransportWithMessageCredential"> > <transport clientCredentialType="None"/> > <message clientCredentialType="UserName" > negotiateServiceCredential="false" establishSecurityContext="false"/> > </security> > > <!--snip--> > > <serviceCredentials> > <userNameAuthentication > userNamePasswordValidationMode="Custom" cacheLogonTokens="true" > > customUserNamePasswordValidatorType="MyValidatorClass, > MyValidatorAssembly [long version]"/> > <windowsAuthentication allowAnonymousLogons="false"/> > </serviceCredentials> > <serviceAuthorization > impersonateCallerForAllOperations="false" > principalPermissionMode="Custom"> > <authorizationPolicies> > <add policyType="MyPolicyClass, MyPolicyAssembly [long > version]" /> > </authorizationPolicies> > </serviceAuthorization> > > The validator would look something like: > > internal sealed class TokenValidator : UserNamePasswordValidator > { > public override void Validate(string userName, string > password) > { > ... > } > } > > > Any use? > > Marc > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Username and Password > If you have one I'd be most gratful. Ah, no; sorry [throws it open to the floor...] |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Vista login "incorrect username or password" with correct username and password entry | Vista General | |||
| Username & password | Vista mail | |||
| username password | Vista General | |||
| backup to a network drive is asking for username and password...whatusername and password? | Vista General | |||
| username and password | Vista mail | |||