admin管理员组文章数量:1289381
I have an existing ASP.NET MVC app on .NET 4.7.2 that we are updating and also trying to implement SSO using WSFederation. In our Startup
class, we have the following code:
public void Configuration(IAppBuilder app)
{
app.MapSignalR();
app.SetDefaultSignInAsAuthenticationType (WsFederationAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = WsFederationAuthenticationDefaults.AuthenticationType
});
app.UseWsFederationAuthentication(new WsFederationAuthenticationOptions
{
MetadataAddress = ";,
Wtrealm = "https://xxxxxxxxxx/appname"
});
}
In our web.config
in the system.web
section, we have the following:
<authentication mode="None" />
<sessionState timeout="15" />
<customErrors mode="Off" />
<authorization>
<deny users="?" />
</authorization>
When we try to run the app locally, we get this error:
Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.
The code does not even try to redirect to the url for authentication, it just immediately throws the error.
--- UPDATE I have added the following in FilterConfig.cs:
filters.Add(new AuthorizeAttribute());
And set authentication mode="forms" in web.config <system.web>
Then it would reach out to login.microsoftonline to authenticate but it seems like its in a loop and not actually returning to my accountsController.
I have added break points in accountsController.Login but it never stops there it just keeps looping as in the SamlTracer above.
So I am closer but still missing something?
本文标签: single sign onASPNET MVC on NET 472 implementing SSOStack Overflow
版权声明:本文标题:single sign on - ASP.NET MVC on .NET 4.7.2 implementing SSO - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741468362a2380448.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论