【发布时间】:2013-06-28 14:08:05
【问题描述】:
我为 Thintecture Identity Server 配置了身份联合(google、facebook、live id)和 WCF SOAP 服务。
现在我需要用于 Windows Phone 应用程序的 WCF Rest Endpoint (webHttpBinding)。我不想在授权标头中传递 WSTrust SAML 令牌。是否可以将 SamlToken 转换为 JWT 令牌以及如何:)?
下面是我试过的代码,但不起作用。
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);
感谢您的帮助。
【问题讨论】:
标签: wif saml federated-identity jwt ws-trust