Skip to content

signout error #19

@yongkeecho

Description

@yongkeecho

Hi,
I have a trouble to setup post_logout_redirect_uri. I tried all the combinations of PostLogoutRedirectUri and have no luck.
Current value for the PostLogoutRedirectUri is /signout/callback.

"OktaDomain": "https://sso_url",
"ClientId": "0oabifez6gJD31bTr997",
"ClientSecret": "v6BiuCOXytcT7Q6_Yw-dgBeZTWz4xzlXSrusAXeofqHrzVpU4bV-Rq265Ve9MOZI",
"AuthorizationServerId": ""

In Program.cs, tried w/ and w/o PostLogoutRedirectUri.

    .AddOktaMvc(new OktaMvcOptions
    {
        OktaDomain = builder.Configuration.GetValue<string>("Okta:OktaDomain"),
        ClientId = builder.Configuration.GetValue<string>("Okta:ClientId"),
        ClientSecret = builder.Configuration.GetValue<string>("Okta:ClientSecret"),
        AuthorizationServerId = builder.Configuration.GetValue<string>("Okta:AuthorizationServerId"),
        //PostLogoutRedirectUri = new PathString(OktaDefaults.SignOutCallbackPath),
        Scope = builder.Configuration.GetValue<string[]>("Okta:Scopes")
    });

In AccountController.cs, tried w/ '~/' and /signout/callback.

        public IActionResult SignOut([FromQuery] string returnUrl)
        {
            if (!User.Identity.IsAuthenticated)
            {
                return LocalRedirect(returnUrl ?? Url.Content("~/"));
            }

            return SignOut(
                //new AuthenticationProperties() { RedirectUri = OktaDefaults.SignOutCallbackPath },
                new AuthenticationProperties() { RedirectUri = Url.Content("~/") },
                [
                    OktaDefaults.MvcAuthenticationScheme,
                    CookieAuthenticationDefaults.AuthenticationScheme,
                ]);
        }

With all cases, the signout button redirects to "https://sso_url/oauth2/v1/logout?post_logout_redirect_uri=https://localhost:7180/signout/callback&...." with an error message of
Error: The 'post_logout_redirect_uri' parameter must be a Logout redirect URI in the client app settings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions