I am currently working on a WPF client that receives a SWT token from Windows Azure AppFabric ACS. With this token, I want to use the RESTful WCF Service. I used this tutorial to get the SWT token and it works great. Using this MSDN tutorial, I created the RESTful WCF service.
The problem is that the token may have the wrong format, because the token validator cannot check it (error in the IsHMACValid method for validating the validator, swtWithSignatur.Length == 1).
An example of a token with which I access the server:
{"appliesTo":"http://localhost:7100/Service/Default.aspx","context":null,"created":1326996221,"expires":1326999821,"securityToken":"<?xml version="1.0" encoding="utf-16"?><wsse:BinarySecurityToken wsu:Id="uuid:74ba5667-04ea-4074-9544-aaafb570c648" ValueType="http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"></wsse:BinarySecurityToken>","tokenType":"http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0"}
In the Windows Azure Management Portal, I selected SWT as the token format for my Relying Party application. According to the first tutorial, the format for the SWT token looks good, but the token validator does not accept it.
PS: If someone tries to complete the second tutorial ("How: Verify the authenticity of the WCF REST service deployed on Windows Azure using ACS"): I think that in step 11 in step 3 there is an error in which you need to change the web.config file web.config (the system/webService does not exist). The configuration should look something like this:
<?xml version="1.0"?> <configuration> <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <add name="SWTModule" type="SecurityModule.SWTModule, SecurityModule" /> </modules> </system.webServer> </configuration>
Robar source share