Pablo,
Thanks for the reply.. much appreciated!
My client is connecting to a custom STS server.. i have no access to the
server source - it is a govt server implementing the msoft GSO offering,
The only thing "custom" about my STS server is that it returns its own
"tokens" in its xml format. I create standard Oasis username tokens, in the
format below ... How can i tell WSE3 to use this usernametoken format? not
the new 2005 oasis version?
<wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="SecurityToken-c80775e7-b8dc-46d4-9312-dbfa65a2b6e9">
<wsse:Username>513FDQ37JILL</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1
.0#PasswordDigest">
6MVcBZAS0SQpitXrRsXntcbugHw=
</wsse:Password>
<wsse:Nonce>C1CRDaeRoqFSrjjMdh3TIA==</wsse:Nonce>
<wsu:Created>2004-06-28T13:00:32Z</wsu:Created>
</wsse:UsernameToken>
I have reverted all my code back to WSE2 and with a bit of "fiddling" i now
have WSE2 working with .NET2 and VS2005... is this a recommended approach?
Below is an example of my WSE2 and WSE3 code, however i cannot see where
your
example using [SoapMethod("01/2005/Issue")] would fit in,
The WSE2 code to do this looks similar to :- [ seeWSE2
CustomXmlSecurityToken example ]
MyClass : SecurityTokenServiceClient
{
public const string TokenServiceAppliesTo =
"urn:XXX-System-Services:external:1.0.0:XXXWebServices";
public const string TokenType =
"urn:XXX-System-Services:external:1.1.1:mytoken#mytoken";
SecurityToken token = UsernameToken(user, passwd);
AppliesTo appliesto = new AppliesTo(TokenServiceAppliesTo);
RequestSecurityToken rst = RequestSecurityToken(TokenType, token,
appliesto);
RequestSecurityTokenResponse rstr = this.IssueSecurityToken(rst);
return rstr.RequestedSecurityToken.SecurityToken as MySecurityToken;
}
Using WSE3
MyClass : SecurityTokenServiceClient
{
public const string TokenServiceAppliesTo =
"urn:XXX-System-Services:external:1.0.0:XXXWebServices";
public const string TokenType =
"urn:XXX-System-Services:external:1.1.1:mytoken#mytoken";
AppliesTo appliesto = new AppliesTo(TokenServiceAppliesTo);
RequestSecurityToken rst = RequestSecurityToken(TokenType)
rst.AppliesTo = appliesTo
// add the username token
UsernameForCertificateAssertion assertion = new
UsernameForCertificateAssertion();
assertion.UsernameTokenProvider = new UsernameTokenProvider(username,
"BadPassword");
Policy policy = new Policy();
policy.Assertions.Add(assertion);
rst.SetPolicy ( policy )
RequestSecurityTokenResponse rstr = this.IssueSecurityToken(rst);
return rstr.RequestedSecurityToken.SecurityToken as MySecurityToken;
}
> Hi Ste,
> WSE 2 is still supported in NET 2.0 and you can use side by side with WSE
[quoted text clipped - 40 lines]
>>
>> Thanks
Pablo Cibraro - 09 Jan 2006 13:30 GMT
Hi Ste,
My sample goes in the Custom STS server but in this case you are not lucky
since you don't have access to that code.
If you want to use a different UsernameToken format, then you will have to
do something like this:
1. Write a custom UsernameToken class
2. Write a custom UsernamenameTokenManager, which knows how to serialize and
deserialize the custom UsernameTokenManager
3. Register the custom UsernameTokenManager in the client application
(Adding a setting in the configuration file).
<microsoft.web.services3>
<security>
<securityTokenManager>
<add type="MyLibrary.CustomUsernameTokenManager, MyAssembly"
namespace="Your Namespace" localName="UsernameToken"/>
</securityTokenManager>
</security>
</microsoft.web.services3>
In this case, WSE 2.0 is working fine, so I recommend you to use that
version. WSE 3.0 is usefull if you are planning to move to Indigo.
Regards,
Pablo Cibraro
http://weblogs.asp.net/cibrax
http://www.lagash.com
> Pablo,
>
[quoted text clipped - 116 lines]
>>>
>>> Thanks