首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >AADSTS900561:端点只接受POST请求。收到一个GET请求

AADSTS900561:端点只接受POST请求。收到一个GET请求
EN

Stack Overflow用户
提问于 2020-08-11 15:53:08
回答 1查看 6.6K关注 0票数 1

我有asp.net网络应用程序。我将此应用程序迁移到azure,并实现Azure AD身份验证。AD身份验证和基于Approle的授权正在按预期工作。我面临的问题,同时签署-退出申请.

AAD-签署-回应-讯息

参考msdn-站点尝试了这些设置以及,但我仍然得到同样的问题。

解决这个问题需要帮助!谢谢!!

我在帐户控制器中的签名方法有以下几个

代码语言:javascript
运行
复制
public void SignOut()
    {

        HttpContext.GetOwinContext()
        .Authentication

        .SignOut(CookieAuthenticationDefaults.AuthenticationType);

        HttpContext.GetOwinContext().Authentication.SignOut(
                 CookieAuthenticationDefaults.AuthenticationType, OpenIdConnectAuthenticationDefaults.AuthenticationType);
 
    }

Startup.cs configauth作为

代码语言:javascript
运行
复制
public void ConfigureAuth(IAppBuilder app)
    {


        app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);


        app.UseCookieAuthentication(new CookieAuthenticationOptions());

        app.UseOpenIdConnectAuthentication(
            new OpenIdConnectAuthenticationOptions
            {
                ClientId = clientId,
                Authority = Authority,
                PostLogoutRedirectUri = redirectUri,
                RedirectUri = redirectUri,
                TokenValidationParameters = new TokenValidationParameters
                {
                    ValidateIssuer = true,
                    NameClaimType = "upn",
                    RoleClaimType = "roles",    // The claim in the Jwt token where App roles are provided.
                },
                Notifications = new OpenIdConnectAuthenticationNotifications()
                {
                    //
                    // If there is a code in the OpenID Connect response, redeem it for an access token and refresh token, and store those away.
                    //
                    AuthorizationCodeReceived = OnAuthorizationCodeReceived,
                    AuthenticationFailed = OnAuthenticationFailed
                }

            });

        // Configure the db context, user manager and signin manager to use a single instance per request
        app.CreatePerOwinContext(ApplicationDbContext.Create);           
        

    }

具有AD配置详细信息的web.config,如下所示

代码语言:javascript
运行
复制
<add key="ida:ClientId" value="xxxxx-xxxx-xx-xxxx-xxxxxxx"/>
<add key="ida:Tenant" value="xxxxxx.onmicrosoft.com"/>
<add key="ida:AADInstance" value="https://login.microsoftonline.com/{0}"/>
<add key="ida:PostLogoutRedirectUri" value="https://login.microsoftonline.com/common/oauth2/v2.0/logoutsession/"/>
<add key="ida:RedirectUri" value="https://xxxxxxxx.azurewebsites.net/"/>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-08-21 02:08:16

我试图重新创建您的问题,如果您像我一样在门户中配置logouturl,您可以尝试删除它,然后运行程序。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63361879

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档