我使用https://myapps.microsoft.com/作为登录页面。
但是,在某些情况下,当我从仪表板上单击我的应用程序时,页面重定向后会话超时。我必须关闭并再次单击它,这是我在页面中获得会话的时间。
第二种情况是我总是收到“错误请求-请求太长错误”。我错过了什么配置?
这是我使用的代码:
public class Logon
{
[Authorize]
public void Authenticate()
{
if (ClaimsPrincipal.Current.Identity.IsAuthenticated)
{
string userfirstname = ClaimsPrincipal.Current.FindFirst(ClaimTypes.GivenName).Value;
string userlastname = ClaimsPrincipal.Current.FindFirst(ClaimTypes.Surname).Value;
// do some checking
// set session and redirect
// when page is redirected to Home Index, session checking occur
Response.Redirect("~/Home/Index");
}
}
}
至于Azure设置
我的主页URL和“答复URL”设置为:托管在本地IIS上的https:// mysite / logon / authenticate。
我通过Azure AD面板中的“应用程序注册”菜单添加了我的应用程序。
谢谢。
您是否使用一组特定的凭据登录?如果用户是太多Azure AD组的一部分,则会发生此问题。您可以删除您所属的用户组的数量,也可以在服务器上增加MaxFieldLength和MaxRequestBytes注册表项的设置,以使用户的请求标头不超过这些值。
参见此处:https : //support.microsoft.com/zh-cn/help/2020943/http-400-bad-request-request-header-too-long-response-to-http-request
另请参阅:https : //medium.com/@marilee.turscak/reply-urls-vs-postlogoutredirecturis-in-azure-active-directory-aad-20f57a03267b
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句