Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Can't log out of Blazor WebAssembly client app

$
0
0

In a fresh Blazor WebAssembly Standalone App (dotnet new blazorwasm --auth Individual), I updated the call to AddOidcAuthentication() to add Google authentication:

builder.Services.AddOidcAuthentication(options =>{    // Configure your authentication provider options here.    // For more information, see https://aka.ms/blazor-standalone-auth    builder.Configuration.Bind("Local", options.ProviderOptions);    options.ProviderOptions.Authority = "https://accounts.google.com/";    options.ProviderOptions.RedirectUri = "https://localhost:7167/authentication/login-callback";    options.ProviderOptions.PostLogoutRedirectUri = "https://localhost:7167/authentication/logout-callback";    options.ProviderOptions.ResponseType = "id_token";    options.ProviderOptions.ClientId = Environment.GetEnvironmentVariable("GOOGLE_CLIENT_ID");});

I am able to log in successfully (I get a token saved in SessionStorage and see that it knows my name), but when I log out, it doesn't "stick". The token is deleted, but when I refresh the page, the token reappears and the app treats me as logged in again. (I'm just using the default code to log in and out.)

Am I doing something wrong that's preventing my logout from "sticking"? Or am I misunderstanding something about Google authentication?

Repo here (but I literally didn't change anything except the code I posted).


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>