How To Add Google Authentication in ASP.NET MVC

Поділитися
Вставка
  • Опубліковано 18 вер 2024
  • In this video tutorial we show how to integrate external social media login in ASP.NET MVC application.
    Using ASP.NET Identity service we demonstrate the step by step approach to integrate Google Login in ASP.NET.
    This video will show you how to configue Google Apps for integrating it in ASP.net application and using Identity service provide the capability to let users register to application using Google oAuth 2.0 Authentication process.
    Prior to this video, we have also released 2 videos on Identity services that help developer to implement Register, Login & Logout along with role based authorization in ASP.NET Application. Links for the same is pasted below.
    Thanks for visiting Digital TechJoint Channel and we wish all the very Best Learning experience .
    Please do Subscribe, Share and like our videos
    🚀 .NET Razor Pages Course
    www.udemy.com/...
    How To Implement AES 256 Encryption in ASP.NET MVC
    • Implementing AES 256 E...
    Learn Visual Studio Code Editor for ASP.NET MVC Application - Complete Tutorial
    • Learn Visual Studio Co...
    How To Implement CRUD Operations in ASP.NET Using ADO.NET - Complete Guide
    • How To Implement CRUD ...
    How To Integrate Stripe Payment Integration in ASP.NET MVC
    • How To Integrate Strip...
    How To Upload Files In Microsoft Azure Storage using ASP.NET Web-API
    • How To Upload Files In...
    How To Upload Files In Microsoft Azure Storage using ASP.NET Web-API
    • How To Upload Files In...
    How To Register Microsoft Azure Free Trial Account
    • How To Register Micro...
    ASP.NET MVC - How to Upload, Download and Delete Files in AWS S3
    • ASP.NET MVC - How to U...
    How To Deploy ASP.NET Application with Azure SQL Database on Microsoft Azure Cloud
    • How To Deploy ASP.NET ...
    How To Integrate ChatGPT in ASP.NET Web API
    • How To Integrate ChatG...
    RazorPay Payment Integration in ASP.NET MVC
    • How To Integrate Razor...
    Blazor Server Vs Blazor WebAssembly Application
    • ASP.NET Blazor Server ...
    Develop Full-Stack Application using Blazor WebAssembly
    • How to Develop Full-St...
    How To Deploy ASP.NET Appliction on AWS Cloud Platform
    • How to Deploy ASP.NET ...
    How To Apply Free Bootstrap in ASP.NET Application
    • How To Apply Free Boot...
    Razor Pages Complete Course Dotnet Framework 6.0
    • Complete Course on Raz...
    Complete Course in ASP.NET MVC 6.0
    • Learn ASP.NET MVC (.NE...
    In this video tutorial we show how to integrate external social media login in ASP.NET MVC application.
    Using ASP.NET Identity service we demonstrate the step by step approach to integrate Google Login in ASP.NET.
    This video will show you how to configue Google OAuth 2.0 App for integrating it in ASP.net application and using Identity service provide the capability to let users login using Gmail Login Credentials
    Prior to this video, we have also released 2 videos on Identity services that help developer to implement Register, Login & Logout along with role based authorization in ASP.NET Application. Links for the same is pasted below.
    How to Setup Amazon AWS Free Account
    • How to Setup Amazon AW...
    AWS Secure Root User Using Identity Access Management Service (IAM)
    • AWS Secure Root User U...
    Intro To ASP.net CORE
    • How To Create Web API ...
    How To Upload Images in Database ASP.NET Razor Pages
    • Razor Pages - How To U...
    Dependency Injection Explained
    • How To Implement Depen...
    ASP.net CORE Using ADO.net
    • How to use ADO.NET in ...
    Repository Pattern Explained
    • How To Implement Repos...
    Getting Started with Razor
    • Getting Started with R...
    Working with Images
    • How to Upload Images U...
    Razor Page Short Videos Playlist
    • Learn ASP.NET Razor Pa...
    Complete ASPNET MVC Course
    • Learn ASP.NET MVC (.NE...
    AWS S3
    • Playlist

КОМЕНТАРІ • 46

  • @rkarimabadi
    @rkarimabadi 3 місяці тому +1

    What a straightforward and clean tutorial. He explained the validation method with Google easily and in the right way. I hope to implement the same in Blazor.

  • @rushikeshsapkal2285
    @rushikeshsapkal2285 12 днів тому +1

    best

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  9 днів тому

      Thank You So much. Please do share our channel link with your friends and colleagues. Thanks

  • @naodteen9492
    @naodteen9492 4 місяці тому +1

    Great Tutorial!! Thank you!!

  • @bushraw66
    @bushraw66 4 місяці тому +1

    you mention encrypting the google keys' values and store them in the database, is there a tutorial for that or can you recommend a tutorial video/document that talk about that in details? thanks so much.

  • @BB-gj7de
    @BB-gj7de Місяць тому

    Thank you for the nice video!

  • @josedavidperalesaltamirano6919
    @josedavidperalesaltamirano6919 4 місяці тому +1

    Muchas gracias!

  • @olimjontajiev1943
    @olimjontajiev1943 5 місяців тому +1

    Thanks bro!

  • @longhothan3574
    @longhothan3574 5 місяців тому +2

    can you make video about login Facebook?

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  4 місяці тому +1

      It's already available in our channel. Thanks

  • @Sanguinecat2001
    @Sanguinecat2001 9 місяців тому +2

    System.NullReferenceException: 'Object reference not set to an instance of an object.'
    Microsoft.AspNetCore.Authentication.AuthenticateResult.Principal.get returned null.
    I'm having this issue, what might be the solution?

    • @Kingmaur086
      @Kingmaur086 8 місяців тому +1

      Great tutorial but i also get the nullreference in Principal. Could it be something to do with http / https configuration when setting up the project or is there any solution found?

    • @TùngNguyễn-c8v7h
      @TùngNguyễn-c8v7h 8 місяців тому +1

      var result = await HttpContext.AuthenticateAsync(GoogleDefaults.AuthenticationScheme);
      work for me

    • @guigamer777g
      @guigamer777g 6 місяців тому

      System.NullReferenceException: 'Object reference not set to an instance of an object.'
      Microsoft.AspNetCore.Authentication.AuthenticateResult.Principal.get returned null.
      I'm having this issue, what might be the solution?

  • @rezamohammadi113
    @rezamohammadi113 8 місяців тому +2

    followed the video, but when the redirect wanted to take place, I got an error. The error text is as follows (error 400: redirect_uri_mismatch)
    The URLs that I added in the Google console were according to the video
    can you help me?

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  6 місяців тому

      Drop us email and I will share across our code.

    • @naodteen9492
      @naodteen9492 4 місяці тому

      What you need to do is open the error page then just copy the url that it gives you there and take that to the credential page of the google console then add that link / paste the link to the redirect link there. It will start working then.

  • @lantisdylan
    @lantisdylan 10 місяців тому +2

    Do you have google authentication using blazor?

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  10 місяців тому +3

      Thanks for Visiting and watching our video on Google Authentication . We don't have it for Blazor but we can surely release one by next week. Thanks

    • @lantisdylan
      @lantisdylan 10 місяців тому

      @@DigitalTECHJOINT Thank You Sir

  • @divyanshurai8893
    @divyanshurai8893 10 місяців тому +1

    Getting error "ArgumentException: The 'ClientId' option must be provided. (Parameter 'ClientId')" before creating controller page (at 11:24)

    • @roma9957
      @roma9957 7 місяців тому +1

      so you have an empty ClientID property. You may have written this property in launch Settings.json, not appsettings.json

  • @alkhulaqidev8930
    @alkhulaqidev8930 Місяць тому

    in google response claims null exception i need help please

  • @divyanshurai8893
    @divyanshurai8893 10 місяців тому +1

    I'm getting error " An unhandled exception occurred while processing the request.
    ArgumentException: The 'ClientId' option must be provided. (Parameter 'ClientId')
    Microsoft.AspNetCore.Authentication.OAuth.OAuthOptions.Validate()" so what should I write in appsettings.json

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  10 місяців тому

      Hope you have set up the oAuth as shown in the video. The message says you are not passing the client id or secret Id in program.cs file. If the problem persists then please do email us and we will share across the source code. thanks

    • @divyanshurai8893
      @divyanshurai8893 10 місяців тому +1

      @@DigitalTECHJOINT at 10:29 in your video I have written options.ClientId="Client_id"; options.ClientSecret="Secret key" so I have directly written client id and Secret key in place of your code for options.ClientId, options.ClientSecret

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  10 місяців тому

      @@divyanshurai8893 Then it should work however please make sure you have setup the oAuth as shown in the tutorial since it's throwing error for client id an secret ket. Try deleting the oAuth setup and re-create and use the updated keys . Please email me so we can share you the source code. thanks

  • @divyanshurai8893
    @divyanshurai8893 10 місяців тому +1

    I also want user profile pic and User email address so how can I retrieve it after user get's signed in at Home page

  • @ayushchourasiya4616
    @ayushchourasiya4616 2 місяці тому

    My application is running but it is giving 401 error: authorisation error The OAuth client was not found.

  • @charbelakl6002
    @charbelakl6002 3 місяці тому

    Access blocked: This app’s request is invalid
    Error 400: redirect_uri_mismatch
    Why would i get this error from google?

  • @ampiahsimonsdefanti5019
    @ampiahsimonsdefanti5019 9 місяців тому +1

    Hi sir. I followed ur video. I am getting this error Exception: Correlation failed. Unknown location Exception: An error was encountered while handling the remote login.
    Can u help ?

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  6 місяців тому

      Drop us email and I will share across our code.

    • @renjuag8279
      @renjuag8279 5 місяців тому +1

      @@DigitalTECHJOINT Same error . Any Solution?

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  4 місяці тому

      @@renjuag8279 Check on the below possibilities
      Ensure that you have properly configured Google Authentication in your ASP.NET application. Double-check your client ID, client secret, callback URL
      Make sure that the redirect URIs specified in your Google Developer Console match the redirect URIs configured in your ASP.NET application
      Check if there are any firewall or proxy settings that might be interfering with the authentication process

    • @renjuag8279
      @renjuag8279 4 місяці тому

      ​@@DigitalTECHJOINT Thanks for your reply. I am with this issue for quite some time. I'm able to successfully authenticate in Local environment. But the issue is in the deployed one. From logs I identified that the call is not coming back to Googlecallback method from Challenge. Logged in User appears on the Profile but getting 500 internal server error

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  4 місяці тому

      @@renjuag8279 In that case, let me review your code. Is your return call back Url for production correct ? basis what you are saying the application is unable to identifty the return callback URl that's why GoogleCallback method is not called. Hope you have updated the required URL /setting for production in google console .. Request to take a step back and review all the parameter once. I am sure it must be some minor gap leading to this issue.

  • @Seyanhyriu
    @Seyanhyriu 8 місяців тому +1

    I'm getting correlation failed error. Can't find the solution on Google

    • @azrqasmzad9397
      @azrqasmzad9397 7 місяців тому

      hello,i have the same problem can you solve it?

    • @renjuag8279
      @renjuag8279 5 місяців тому

      @@azrqasmzad9397 Any solution for this?

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  4 місяці тому

      @@azrqasmzad9397 Check on the below possibilities
      Ensure that you have properly configured Google Authentication in your ASP.NET application. Double-check your client ID, client secret, callback URL
      Make sure that the redirect URIs specified in your Google Developer Console match the redirect URIs configured in your ASP.NET application
      Check if there are any firewall or proxy settings that might be interfering with the authentication process

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  4 місяці тому

      Check on the below possibilities
      Ensure that you have properly configured Google Authentication in your ASP.NET application. Double-check your client ID, client secret, callback URL
      Make sure that the redirect URIs specified in your Google Developer Console match the redirect URIs configured in your ASP.NET application
      Check if there are any firewall or proxy settings that might be interfering with the authentication process

  • @huseyinunver5172
    @huseyinunver5172 3 місяці тому

    System.NullReferenceException: 'Object reference not set to an instance of an object.'
    Microsoft.AspNetCore.Authentication.AuthenticateResult.Principal.get returned null.
    I'm having this issue, what might be the solution?

  • @guigamer777g
    @guigamer777g 6 місяців тому +1

    in google response claims null exception i need help please

    • @DigitalTECHJOINT
      @DigitalTECHJOINT  6 місяців тому

      Drop us email and I will share across our code.