Skip to content
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

Logout does not work every time #2

Open
soend opened this issue Nov 27, 2020 · 3 comments
Open

Logout does not work every time #2

soend opened this issue Nov 27, 2020 · 3 comments

Comments

@soend
Copy link

soend commented Nov 27, 2020

Hello,
I tested this nuget and found one issue. In some cases when i press logout, page reloads but im still logged in. Pressing second time only logs me out. I also tested and logging out works first time if i log in, refresh the page myself and then click logout.
Any idea what could be causing this issue?

@StefH
Copy link
Owner

StefH commented Nov 28, 2020

@soend maybe you can set: options.AuthenticationPaths.LogOutSucceededPath = "";

See example:
https://github.com/StefH/BlazorWasmGrpcWithAADAuth/blob/master/BlazorWasmGrpcWithAADAuth/Client/Program.cs#L47

@soend
Copy link
Author

soend commented Nov 29, 2020

Adding that line didnt help. This behavior is very sttrange, just randomly it decides not to log out.

@soend
Copy link
Author

soend commented Dec 1, 2020

I think i figured it out. It seems to be important to call the Auth0 logout endpoint before i navigate to authentication/logout in the blazor app.
So for testing i changed BeginSignOut function to look like this

private async Task BeginSignOut(MouseEventArgs args)
{
    await SignOutManager.SetSignOutState();

    var authority = (string)Configuration["Auth0:Authority"];
    var clientId = (string)Configuration["Auth0:ClientId"];

    Navigation.NavigateTo($"{authority}/v2/logout?client_id={clientId}");
}

In Auth0 Applications settings set the Allowed LogoutURLs to https://YOURDOMAIN/authentication/logout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants