Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

Username and Password

 
 
Thread Tools Display Modes
Old 06-03-2007   #1 (permalink)
Craig
Guest
 
Posts: n/a

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
 
Old 06-03-2007   #2 (permalink)
Marc Gravell
Guest
 
Posts: n/a

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

 
Old 06-03-2007   #3 (permalink)
Craig
Guest
 
Posts: n/a

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
>
>

 
Old 06-04-2007   #4 (permalink)
Marc Gravell
Guest
 
Posts: n/a

Re: Username and Password

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

[throws it open to the floor...]


 
 
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
username and password loki Vista mail 0 03-13-2008 10:09 AM
backup to a network drive is asking for username and password...whatusername and password? Lisa Hetherington Vista General 7 02-04-2008 09:35 AM
username and password Denise Martell Vista mail 3 01-08-2008 02:15 PM
Username and Password Gudmund Liebach Nielsen Vista mail 20 10-11-2007 01:19 PM
username and password rachelle Vista mail 2 09-27-2007 01:25 AM








Vistax64.com 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 2005-2008

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 47 48 49