Hi @biprism ,
Here is a simple sample about implement Google Authentication in Blazor server application without using Asp.net core Identity, you can check it:
- Create a new Asp.net core Blazor Server application, without select the "Individual Accounts" type.
- Install the Microsoft.AspNetCore.Authentication.Google package via Nuget.
- Refer to the Google Authentication document and Create the Google OAuth 2.0 Client ID and secret.
- Configure the Authentication Pipeline.
Open the appsettings.json file and add the Google configuration. Like this: Open the program.cs file (this is a Asp.net 6 application, if you are using the lower version, you can add the configuration in the startup.cs file), add the yellow part of code: - Create Login page, Logout page and LoginControl component: You can view the page source from here: 197626-loginpage.txt 197627-logoutpage.txt 197692-logincontrol.txt Then, add the LoginControl component in the MainLayout.razor component:
Finally, running the application, the result like this:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion