-
Notifications
You must be signed in to change notification settings - Fork 10.3k
.Net Core SignOut() RedirectUri not working #28009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here's the part where the signout starts. It forwards the RedirectUri via a state property just like Challenge does. aspnetcore/src/Security/Authentication/OpenIdConnect/src/OpenIdConnectHandler.cs Lines 216 to 217 in 930fd52
And here's where it comes back: aspnetcore/src/Security/Authentication/OpenIdConnect/src/OpenIdConnectHandler.cs Lines 295 to 300 in 930fd52
If you trace the request do you see the state field coming back? If you hook into the SignedOutCallbackRedirect event do you see the RedirectUri you set in the Properties? |
@Tratcher beat me to it but I'll add that it seems not all open ID connect providers actually call the sign out callback, or if they do its just a static preconfigured URL they'll hit--without the state information passed in. If you don't see the callback getting called that could be why. OpenID Connect and OAuth sign out isn't as well-defined out as sign in. |
@Tratcher The OnRedirectToIdentityProviderForSignOut event does show the .redirectUri property. OnRemoteSignOut does not and I can see the state field present when it reaches the signed out callback path: @AndrewTriesToCode Do you think the fact that |
Makes sense. It's interesting it called OnRemoteSignOut instead. That's normally reserved for notifications that a central sign-out was requested by another application. It might also be a registration issue. You've registered the login callback path ("/signin-oidc") with Oracle, right? What about the signed out callback path "/signout-callback-oidc"? aspnetcore/src/Security/Authentication/OpenIdConnect/src/OpenIdConnectOptions.cs Lines 40 to 41 in 930fd52
|
Yes I do have /signin-oidc configured in Oracle under the I can see that the post_logout_redirect_uri is not set correctly in the logout API call. It always uses the OIDC |
That's expected. It's supposed to return to "/signout-callback-oidc" and then be redirected locally to your RedirectUri. Make sure "/signout-callback-oidc" is registered as a valid Post Logout Redirect Uri. |
@Tratcher I was setting the OIDC SignedOutCallbackPath to "/signout-oidc" and apparently that causes the the RedirectUri to not be used. I'm not sure why. After registering the default "/signout-callback-oidc" value in IDCS instead, it works - I'm good with this. Thanks for your help. |
aspnetcore/src/Security/Authentication/OpenIdConnect/src/OpenIdConnectOptions.cs Lines 40 to 41 in 84b77de
|
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes. See our Issue Management Policies for more information. |
I'm trying to do a SignOut with a
redirect uri
specified in theAuthenticationProperties
. It redirects to the OIDC SignedOutCallbackPath I configured but doesn't make it to the RedirectURI.Setup and info:
A login via ChallengeRequest with a RedirectUri on the other hand works.
How does the Redirect URI actually work inside - ex. does it get sent to the Identity Provider and back? Any clues as to why this doesn't work?
The text was updated successfully, but these errors were encountered: