Jay
3 Jan. 11:38 Optionen anzeigen
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices .enhancements
Von: "Jay" <p.brunm...@nus urf.at> - Nachrichten dieses Autors suchen
Datum: 3 Jan 2006 02:38:30 -0800
Lokal: Di 3 Jan. 2006 11:38
Betreff: Referenced security token could not be retrieved
Antworten | Antwort an Autor | Weiterleiten | Drucken | Einzelne Nachricht |
Original anzeigen | Entfernen | Missbrauch melden
Hi@all
I ve got a strange problem with my custom security token. I ve added
the token to the security elements and a messagesignatur e with the same
token as described in the WSE 2.0 documentation.
I derived a class from SecurityTokenSe rviceClient to communicate with
my STS. Here is a snippet from where i try to get the requested
security token
public void TryGetToken()
{
// the request for a security token
RequestSecurity Token rst;
rst = new RequestSecurity Token(
"http://updates.dvo.at/tokens/LiveUpdateToken #LiveUpdateToke n", //
requested type
"http://localhost/LiveUpdateToken Service/TokenService.as hx"); // my
STS
//custom XML token based on the XML token from the CustomXMLToken
Service. I 've added some extra field which i need to validate
LiveUpdateReque stToken f = new LiveUpdateReque stToken("Patric k",
"Brunmayr", "hansi", "1000");
this.RequestSoa pContext.Securi ty.Tokens.Add( f ); // Add the token
to the security elements
this.RequestSoa pContext.Securi ty.Elements.Add ( new
MessageSignatur e(f)); // add a signature to sign the request
base.IssueSecur ityToken(rst); // call the STS and try to get the
security token
}
When i call base.IssueSecur ityToken(rst) i alwasy get this
SoapExcpetion
<soap:Fault>
<faultcode
xmlns:code="htt p://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-se...">code:Sec urityTokenUnava ilable</faultcode>
<faultstring>Mi crosoft.Web.Ser vices2.Security .SecurityFault: Referenced
security token could not be retrieved
at Microsoft.Web.S ervices2.Securi ty.MessageSigna ture.CheckSigna ture()
at Microsoft.Web.S ervices2.Securi ty.Security.Loa dXml(XmlElement
element)
at
Microsoft.Web.S ervices2.Securi ty.SecurityInpu tFilter.Process Message(SoapEnv Â*elope
envelope)
at Microsoft.Web.S ervices2.Pipeli ne.ProcessInput Message(SoapEnv elope
envelope)
at
Microsoft.Web.S ervices2.Messag ing.SoapReceive r.FilterMessage (SoapEnvelope
envelope)
at
Microsoft.Web.S ervices2.Messag ing.SoapReceive r.ProcessMessag e(SoapEnvelope
message)</faultstring>
<faultactor>htt p://localhost/LiveUpdateToken Service/TokenService.as hx</faultactor>
</soap:Fault>
But i don't understand this beacuse my token is present in the Soap
header. Here the SoapMessage from the trace
<soap:Envelop e
xmlns:wsa="http ://schemas.xmlsoap .org/ws/2004/03/addressing"
xmlns:wsse="htt p://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-se..."
xmlns:wsu="http ://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-ut..."xmlns:soa p="http://schemas.xmlsoap .org/soap/envelope/">
<soap:Header>
<wsa:Action
wsu:Id="Id-3d8b7914-b86d-471a-8f97-1893b99530ef">h ttp://schemas.xmlsoap .org/ws/2004/04/security/trust/RST/Issue</wsa:Action>
<wsa:MessageI D
wsu:Id="Id-512d289f-2425-4bc2-8cab-f2e78c5677ba">u uid:e80f2392-728a-41d9-8cÂ*8a-73ed2aae3f90</wsa:MessageID>
<wsa:ReplyTo wsu:Id="Id-be1ddfa6-4905-439a-be09-9fc46a9ab710">
<wsa:Address>ht tp://schemas.xmlsoap .org/ws/2004/03/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:To
wsu:Id="Id-1e50cadc-6083-4c0b-a091-2e55a91059a6">h ttp://localhost/LiveUpdateToken Service/TokenService.as hx</wsa:To>
<wsse:Securit y soap:mustUnders tand="1">
<wsu:Timestam p wsu:Id="Timesta mp-b189d2ef-e3e5-4f3c-b724-45d41d31c76e">
<wsu:Created>20 06-01-03T10:15:57Z</wsu:Created>
<wsu:Expires>20 06-01-03T10:20:57Z</wsu:Expires>
</wsu:Timestamp>
// here is my token
<dvo:LiveUpdate RequestToken
wsu:Id="Securit yToken-489fdbb5-d56e-44e1-9890-a308657f047f"
xmlns:dvo="http ://updates.dvo.at/tokens/LiveUpdateReque stToken">
<dvo:CreatedAt> 2006-01-03T10:15:56Z</dvo:CreatedAt>
<dvo:ExpiresAt> 2006-01-03T18:15:56Z</dvo:ExpiresAt>
<dvo:Email>???? ????</dvo:Email>
<dvo:Password>? ???????????</dvo:Password>
<dvo:WTNumber>? ???????</dvo:WTNumber>
<dvo:ProgrammCo de>????????</dvo:ProgrammCod e>
</dvo:LiveUpdateR equestToken>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<ds:Canonicaliz ationMethod
Algorithm="http ://www.w3.org/2001/10/xml-exc-c14n#"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" />
<SignatureMetho d
Algorithm="http ://www.w3.org/2000/09/xmldsig#hmac-sha1" />
<Reference URI="#Id-3d8b7914-b86d-471a-8f97-1893b99530ef">
<Transforms>
<Transform Algorithm="http ://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http ://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>tJ fDGaqEs7y0Irw2o QBtjSQ+5jY=</DigestValue>
</Reference>
<Reference URI="#Id-512d289f-2425-4bc2-8cab-f2e78c5677ba">
<Transforms>
<Transform Algorithm="http ://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http ://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>1A t17jkhs39o9wiXH OJmh25Kwsk=</DigestValue>
</Reference>
<Reference URI="#Id-be1ddfa6-4905-439a-be09-9fc46a9ab710">
<Transforms>
<Transform Algorithm="http ://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http ://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>pn lzF1vVnTwatB7NL jXkbgOzC4A=</DigestValue>
</Reference>
<Reference URI="#Id-1e50cadc-6083-4c0b-a091-2e55a91059a6">
<Transforms>
<Transform Algorithm="http ://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http ://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>Iz prExuvm/t4Jnsl94j/ITkP53o=</DigestValue>
</Reference>
<Reference URI="#Timestamp-b189d2ef-e3e5-4f3c-b724-45d41d31c76e">
<Transforms>
<Transform Algorithm="http ://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http ://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>6Q EFpK/PrJVbzLxTnUtAYK gbJ5g=</DigestValue>
</Reference>
<Reference URI="#Id-392047ac-59c7-4df7-983f-8fdd8864bc38">
<Transforms>
<Transform Algorithm="http ://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http ://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>Bd nuQuQFhi0IIfiUW crtBD5QLFQ=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue >oT+qphdjdHqOm6 mhwv78nNQj7N8=</SignatureValue>
<KeyInfo>
<wsse:SecurityT okenReference>
// here is the reference to my token. This Section was added from WSE
<wsse:Referen ce
URI="#SecurityT oken-489fdbb5-d56e-44e1-9890-a308657f047f"
ValueType="http ://updates.dvo.at/tokens/LiveUpdateReque stToken#LiveUpd ateRequest..."/>
</wsse:SecurityTo kenReference>
</KeyInfo>
</Signature>
</wsse:Security>
</soap:Header>
<soap:Body wsu:Id="Id-392047ac-59c7-4df7-983f-8fdd8864bc38">
<wst:RequestSec urityToken
xmlns:wst="http ://schemas.xmlsoap .org/ws/2004/04/trust">
<wst:TokenType> http://updates.dvo.at/tokens/LiveUpdateToken #LiveUpdateToke n</wst:TokenType>
<wst:RequestTyp e>http://schemas.xmlsoap .org/ws/2004/04/security/trust/Issue</wst:RequestType >
<wsp:AppliesT o
xmlns:wsp="http ://schemas.xmlsoap .org/ws/2002/12/policy">
<wsa:EndpointRe ference>
<wsa:Address>ht tp://localhost/LiveUpdateToken Service/TokenService.as hx</wsa:Address>
</wsa:EndpointRef erence>
</wsp:AppliesTo>
<wst:LifeTime >
<wsu:Expires>20 06-01-03T14:15:57Z</wsu:Expires>
</wst:LifeTime>
</wst:RequestSecu rityToken>
</soap:Body>
</soap:Envelope>
I dont know why WSE cant find the token? Did anybode have the same
problem? Please Help me this drives my crazy