Groups | Blog | Home
all groups > dotnet web services enhancements > january 2005 >

dotnet web services enhancements : RequestSecurityToken fails


Matthias H.
1/21/2005 7:23:02 AM
Hi guys,

I am trying to request a CustomXMLSecurityToken from a web application.

<code>

SecurityToken token = new UsernameToken("xxx", "yyy",
PasswordOption.SendPlainText );
SecurityTokenServiceClient client = new SecurityTokenServiceClient(new
Uri("http://host/folder/CustomXMLTokenServiceHandler.ashx"));
RequestSecurityToken rst = new
RequestSecurityToken("MyNameSpace#CustomXMLToken", token,
"http://host/folder/CustomXMLTest.asmx");
RequestSecurityTokenResponse response;
response = client.IssueSecurityToken( rst );
CustomXMLToken issuedToken = response.RequestedSecurityToken.SecurityToken
as CustomXMLToken;

</code>

And when I run it I am getting the error "WSE101: An asynchronous operation
raised an exception."

In the web.config of the web application is the following:

<code snippets>

<httpHandlers>
<add type = "MyNamespace.CustomXMLTokenServiceHandler, CustomXMLToken"
path="http://host/folder/CustomXMLTokenServiceHandler.ashx" verb="*" />
</httpHandlers>

<tokenIssuer>
<serverToken>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:KeyIdentifier
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier">ZPGrPnuqATeSgVjLYcmiY/GSWWY=</wsse:KeyIdentifier>
</wsse:SecurityTokenReference>
</KeyInfo>
</serverToken>
</tokenIssuer>

</code snippets>

I dont know why there is the TokenIssuer tag, but in the example there was
one. An CustomXMLTokenManager is registered too.
Does anyone have an idea what I am doing wrong?
Sidd
1/25/2005 9:55:45 AM
Hi Matthias,

Have you tried just doing:

<httpHandlers>
<add type = "MyNamespace.CustomXMLTokenServiceHandler, CustomXMLToken"
path="CustomXMLTokenServiceHandler.ashx" verb="*" />
</httpHandlers>

Please make sure that a virtual directory exists to the directory this this
web.config is located in.

The <tokenIssuer> tag is to configure the token issuer that is going to
issue you your CustomXmlSecurityToken. In particular, this section has many
things that can be configured, for example, how long the CustomSecurityToken
it issues you is valid for, the type of "server token" that this token
issuer uses to sign back the RSTR (which is the response that contains your
custom token), etc..

Were you able to run the CustomXmlSecurity token sample, or was it the
sample that was creating problems?

Thanks,

Sidd [MSFT]

[quoted text, click to view]
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
ty-secext-1.0.xsd">
[quoted text, click to view]
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-toke
n-profile-1.0#X509SubjectKeyIdentifier">ZPGrPnuqATeSgVjLYcmiY/GSWWY=</wsse:K
eyIdentifier>
[quoted text, click to view]

AddThis Social Bookmark Button