Blazor template issues with Google Authentication [dotnet 8 rc2] #51402
Labels
Docs
This issue tracks updating documentation
Needs: Author Feedback
The author of this issue needs to respond in order for us to continue investigating this issue.
Milestone
Is there an existing issue for this?
Describe the bug
There are some issues with google authentication when using blazor templates from the dotnet 8 rc2.
Expected Behavior
Steps To Reproduce
Create new blazor project:
dotnet new blazor -n AuthTest -au Individual -int Auto -ai
Add the google package:
dotnet add package Microsoft.AspNetCore.Authentication.Google --version 7.0.12
Add .AddGoogle() section in Program.cs:
Add your client id and secret to the appsettings.json:
The ClientId and ClientSecret are taken from console.cloud.google.com:

after creating a project, go to
Api & Services -> Credentials
Then create new OAuth Client ID

Set the type of Web Application

Set redirect uri similar to this, but put there your port that will be probably different than mine

Once you have client id and secret you will be able to log in with Google.

However when I try to enter the
/account/manage/
endpoint (when I click on the link with my first and last name in the menu) I am redirected to InvalidUser page:There is another thing:

When I try to enter "Auth Required" page, I see my first name and last name for a brief moment, but then I think the web assembly kicks in and swaps it with my email:
Exceptions (if any)
No response
.NET Version
8.0.100-rc.2.23502.2
Anything else?
No response
The text was updated successfully, but these errors were encountered: