You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update google-logins.md by using Google.Apis.Auth.AspNetCore3 package (#33710)
* Update google-logins.md by using Google.Apis.Auth.AspNetCore3 package
using https://developers.google.com/identity/sign-in/web/sign-in
old link lead me for wrong integration for that I search for new links and found it for that I Contribute to help others to try this approach
This is my fist Contribution in open source ,I hope I do great.
* Update google-logins.md
* Update google-logins.md
* Update google-logins.md
* Update google-logins.md
* Update google-logins.md
* Update google-logins.md
* Update aspnetcore/security/authentication/social/google-logins.md
Co-authored-by: Rick Anderson <[email protected]>
* Update aspnetcore/security/authentication/social/google-logins.md
Co-authored-by: Rick Anderson <[email protected]>
* Update google-logins.md
* Update google-logins.md
* Update google-logins.md
* Update google-logins.md
* Update aspnetcore/security/authentication/social/google-logins.md
Co-authored-by: Wade Pickett <[email protected]>
* Update aspnetcore/security/authentication/social/google-logins.md
Co-authored-by: Wade Pickett <[email protected]>
* Update aspnetcore/security/authentication/social/google-logins.md
Co-authored-by: Wade Pickett <[email protected]>
* Update aspnetcore/security/authentication/social/google-logins.md
Co-authored-by: Wade Pickett <[email protected]>
* Update aspnetcore/security/authentication/social/google-logins.md
---------
Co-authored-by: Rick Anderson <[email protected]>
Co-authored-by: Wade Pickett <[email protected]>
By [Valeriy Novytskyy](https://github.com/01binary) and [Rick Anderson](https://twitter.com/RickAndMSFT)
12
+
By [Valeriy Novytskyy](https://github.com/01binary), [Rick Anderson](https://twitter.com/RickAndMSFT) and [Sharaf Abacery](https://github.com/sharafabacery)
13
13
14
14
This tutorial shows you how to enable users to sign in with their Google account using the ASP.NET Core project created on the [previous page](xref:security/authentication/social/index).
15
15
16
16
## Create the Google OAuth 2.0 Client ID and secret
17
17
18
-
* Follow the guidance in [Integrating Google Sign-In into your web app](https://developers.google.com/identity/sign-in/web/sign-in) (Google documentation).
18
+
* Follow the guidance in [Integrating Google Sign-In into your web app](https://developers.google.com/identity/gsi/web/guides/overview) (Google documentation)
19
19
* Go to [Google API & Services](https://console.cloud.google.com/apis).
20
20
* A **Project** must exist first, you may have to create one. Once a project is selected, enter the **Dashboard**.
21
21
@@ -53,37 +53,21 @@ You can manage your API credentials and usage in the [API Console](https://conso
53
53
54
54
## Configure Google authentication
55
55
56
-
Add the [`Microsoft.AspNetCore.Authentication.Google`](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Google) NuGet package to the app.
57
-
58
-
:::moniker range="< aspnetcore-6.0"
59
-
60
-
Add the Authentication service to the `Startup.ConfigureServices`:
* Add the [`Google.Apis.Auth.AspNetCore3`](https://www.nuget.org/packages/Google.Apis.Auth.AspNetCore3) NuGet package to the app.
57
+
* Add the Authentication service to the `program.cs`:
58
+
* Follow [`Add Authtication for asp.net app`](https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#configure-your-application-to-use-google.apis.auth.aspnetcore3)
* Get a link to the libary at [google developer library link ](https://developers.google.com/identity/gsi/web/guides/client-library) to get link of library.
64
+
* Then go to [google developer button genration ](https://developers.google.com/identity/gsi/web/tools/configurator)
65
+
* Setup your Controller to match with ` data-login_uri="{HostName}/{ControllerName}/{actionName}" ` attrbute because after success login it will forward you to that link.
66
+
* Create a controller and action that takes one argument `string credential`, which is returned by Google upon completing the login process.
67
+
* Verify the `credential` using the following line of code:
* This will retrieve the available information about the logged-in user, which could then be stored in a database.
77
70
78
-
* Run the app and select **Log in**. An option to sign in with Google appears.
79
-
* Select the **Google** button, which redirects to Google for authentication.
80
-
* After entering your Google credentials, you are redirected back to the web site.
81
-
82
-
[!INCLUDE[Forward request information when behind a proxy or load balancer section](includes/forwarded-headers-middleware.md)]
83
-
84
-
[!INCLUDE[](includes/chain-auth-providers.md)]
85
-
86
-
For more information on configuration options supported by Google authentication, see the <xref:Microsoft.AspNetCore.Authentication.Google.GoogleOptions> API reference . This can be used to request different information about the user.
0 commit comments