A custom login page for Azure ACS not working

后端 未结 1 747
北恋
北恋 2021-01-07 08:05

I downloaded the sample login page from the ACS portal for my application, which is a html file. I then configured my application with WIF, and everything worked perfectly.

相关标签:
1条回答
  • 2021-01-07 08:27

    The "issuer" should still be ACS, not your site (unless you implement your own STS, which doesn't look like you want to). Issuer == STS in WIF configuration.

    The best candidate to preserve state (e.g. urls, etc) across the token negotiation (which happens through redirects) is through the wctx parameter. You can set this programatically.

    Look at the sample #7 from this download: http://www.microsoft.com/download/en/details.aspx?id=27289

    Chapter: http://msdn.microsoft.com/en-us/library/hh446534.aspx from this Guide: http://msdn.microsoft.com/en-us/library/ff423674.aspx

    The code looks like this (fragment):

    var returnUrl = GetReturnUrl(context.RequestContext);
    
    // user is not authenticated and it's entering for the first time
    var fam = FederatedAuthentication.WSFederationAuthenticationModule;
    var signIn = new SignInRequestMessage(new Uri(fam.Issuer), fam.Realm)
                    {
                        Context = returnUrl.ToString(),
                        Realm = string.Format("https://localhost/f-shipping.7/{0}", organizationName)
                    };
    
    context.Result = new RedirectResult(signIn.WriteQueryString());
    
    0 讨论(0)
提交回复
热议问题