开发者

WIF return to the RP application

I am bu开发者_JAVA技巧ilding a WIF STS and I am able to generate a token. How do I return the token back to the orignal URL. I've noticed this is present in the wctx parameter in the form ru=. How do i extract this without manually parsing this as a string?


If you want to return the token back to the relying party, you can just use the ProcessRequest method similar to this:

    var claims = new List<Claim>
    {
        new Claim(WSIdentityConstants.ClaimTypes.Name, User.Identity.Name),
        new Claim(ClaimTypes.AuthenticationMethod, FormsAuthenticationHelper.GetAuthenticationMethod(User.Identity))
    };

        var identity = new ClaimsIdentity(claims, STS.TokenServiceIssueTypes.Native);
        var principal = ClaimsPrincipal.CreateFromIdentity(identity);

        FederatedPassiveSecurityTokenServiceOperations.ProcessRequest(
            Request,
            principal,
            StarterTokenServiceConfiguration.Current.CreateSecurityTokenService(),
            Response);

If you're just looking to extract the URL parameters, take a look at WSFederationMessage.CreateFromUri.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜