Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - Username and Password

 
 
Old 06-03-2007   #1 (permalink)
Craig


 
 

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 SpecsSystem Spec
Old 06-04-2007   #2 (permalink)
Marc Gravell


 
 

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 SpecsSystem Spec
Old 06-04-2007   #3 (permalink)
Craig


 
 

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 SpecsSystem Spec
Old 06-04-2007   #4 (permalink)
Marc Gravell


 
 

Re: Username and Password

> If you have one I'd be most gratful.
Ah, no; sorry

[throws it open to the floor...]


My System SpecsSystem Spec
 

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


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46