1
votes

I configured Thintecture Identity Server with identity federation (google, facebook, live id), and WCF SOAP service.

Now I need WCF Rest Endpoint (webHttpBinding) for Windows Phone application. I don't want to pass WSTrust SAML token in authorization header. Is possible to convert SamlToken into JWT token and how:)?

Below is code I tried, but doesn't work.

var factory = new WSTrustChannelFactory(
    new WindowsWSTrustBinding(SecurityMode.Transport),
    new EndpointAddress("https://identityserver.local/issue/???"))
{
    TrustVersion = TrustVersion.WSTrust13
};

var rst = new RequestSecurityToken
{
    RequestType =  RequestTypes.Issue,
    KeyType = KeyTypes.Bearer,
    TokenType = TokenTypes.JsonWebToken,
    AppliesTo = new EndpointReference("http://my.realm/")
};

var securityToken = xmlToken.ToSecurityToken();
var response = factory.CreateChannelWithIssuedToken(securityToken).Issue(rst);

Thanks for help.

1

1 Answers

0
votes

You can configure IdentityServer to return JWT. Go to global config and change the default token type to JWT (same value as the default http token type). That should do it.

Update: Why are you using WSTrust at all - IdSrv does not support authentication with e.g. google over WS-Trust.