Skip to content

Commit 1d5b475

Browse files
MackinnonBuckhalter73
authored andcommitted
Provide Microsoft.AspNetCore.Authentication.Google package README (#57768)
Co-authored-by: Stephen Halter <halter73@gmail.com>
1 parent 850d302 commit 1d5b475

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

src/Security/Authentication/Google/src/Microsoft.AspNetCore.Authentication.Google.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Description>ASP.NET Core contains middleware to support Google's OpenId and OAuth 2.0 authentication workflows.</Description>
4+
<Description>ASP.NET Core contains middleware to support Google's OAuth 2.0 authentication workflow.</Description>
55
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<PackageTags>aspnetcore;authentication;security</PackageTags>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## About
2+
3+
`Microsoft.AspNetCore.Authentication.Google` contains middleware to support Google's OAuth 2.0 authentication workflow.
4+
5+
## How to Use
6+
7+
To use `Microsoft.AspNetCore.Authentication.Google`, follow these steps:
8+
9+
### Installation
10+
11+
```shell
12+
dotnet add package Microsoft.AspNetCore.Authentication.Google
13+
```
14+
15+
### Configuration
16+
17+
1. Refer to the guide in the official documentation [here](https://learn.microsoft.com/aspnet/core/security/authentication/social/google-logins#create-the-google-oauth-20-client-id-and-secret) to configure the Google OAuth 2.0 client ID and secret
18+
2. Follow the steps in the official documentation [here](https://learn.microsoft.com/aspnet/core/security/authentication/social/google-logins#store-the-google-client-id-and-secret) to store the Google client ID and secret
19+
3. Add the Authentication service to your app's `Program.cs`:
20+
```csharp
21+
var builder = WebApplication.CreateBuilder(args);
22+
23+
builder.Services.AddAuthentication().AddGoogle(googleOptions =>
24+
{
25+
googleOptions.ClientId = builder.Configuration["Authentication:Google:ClientId"];
26+
googleOptions.ClientSecret = builder.Configuration["Authentication:Google:ClientSecret"];
27+
});
28+
```
29+
30+
## Main Types
31+
32+
The main types provided by this package are:
33+
34+
* `GoogleOptions`: Represents the options for configuring Google authentication
35+
* `GoogleHandler`: The authentication handler responsible for processing Google authentication requests and generating the appropriate authentication ticket
36+
37+
## Additional Documentation
38+
39+
For additional documentation and examples, refer to the [official documentation](https://learn.microsoft.com/aspnet/core/security/authentication/social/google-logins) on Google login setup in ASP.NET Core.
40+
41+
## Feedback &amp; Contributing
42+
43+
`Microsoft.AspNetCore.Authentication.Google` is released as open-source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/aspnetcore).

0 commit comments

Comments
 (0)