1

在我们的 ASP.Net 项目中,我使用“ Kentor.AuthServices ”作为 SAML2 身份验证服务。出于测试目的,我使用的是“Kentor.AuthServices.StubIDP”。

目前我们在页面中给出了一个带有href的锚标记: href=@Url.Content("~/AuthServices/SignIn?idp=" + entityId)

这工作得很好,一旦我们单击锚标记,它就会被重定向到身份提供者: http://localhost:17009//SamplePath/AuthServices/SignIn?idp=http://stubidp.kentor.se/Metadata

但是我们需要实现的是不使用锚标签,直接在浏览器中输入我们的站点URL地址,它应该会自动重定向到身份提供者。

4

1 回答 1

1

使用 HttpModule 时,您使用 web.config 中的表单身份验证设置来将未经身份验证的请求重定向到登录顺序。

<authentication mode="Forms">
    <forms loginUrl="~/AuthServices/SignIn"></forms>
</authentication>
于 2016-07-14T08:49:15.213 回答