dotnet / dotnet/aspnetcore

OpenIdConnect signout-callback-oidc stays blank

Open
#66,241 1 comment 0 reactions 0 assignees View on GitHub
area-auth question
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

I'm using the following API-endpoint to sign out from my SPA:

```
[HttpGet("[action]")]
public ActionResult Logout()
{
return SignOut(new AuthenticationProperties { RedirectUri = "http://localhost:4200/authentication/login" },
CookieAuthenticationDefaults.AuthenticationScheme,
"MyScheme");
}
```

I also enabled SaveTokens in the OpenidConnect options.
Here is what happens

- Client application redirects to API-Endpoint http://localhost:5272/api/Authentication/Logout
- This redirects to "openid-connect/logout?post_logout_redirect_uri=http://localhost:5272/signout-callback-oidc&id_token_hint=..." in keycloak (the IDP I'm using)
- The IDP redirects to http://localhost:5272/signout-callback-oidc?state=CfDJ8DmKONL38F5N
- The page stays blank, the status code is 200

Why isn't it redirecting to the RedirectUri I passed in the SignOut method? It seems to be completely ignored. Only solution I found is to use the "OnRedirectToIdentityProviderForSignOut" event to manually set the post_logout_redirect_uri directly to the final RedirectUri.

### Expected Behavior

_No response_

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version

10.0.3

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.