Skip to content

Commit fa525ca

Browse files
Provide Microsoft.AspNetCore.Authentication.Facebook package README (dotnet#57786)
1 parent f69352e commit fa525ca

File tree

1 file changed

+44
-0
lines changed
  • src/Security/Authentication/Facebook/src

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## About
2+
3+
`Microsoft.AspNetCore.Authentication.Facebook` provides ASP.NET Core middleware that enables an application to support Facebook's OAuth 2.0 authentication workflow.
4+
5+
## How to Use
6+
7+
To use `Microsoft.AspNetCore.Authentication.Facebook`, follow these steps:
8+
9+
### Installation
10+
11+
```shell
12+
dotnet add package Microsoft.AspNetCore.Authentication.Facebook
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/facebook-logins#create-the-app-in-facebook) to create the app in Facebook.
18+
2. Follow the steps in the official documentation [here](https://learn.microsoft.com/aspnet/core/security/authentication/social/facebook-logins#store-the-facebook-app-id-and-secret) to store the Facebook app ID and secret.
19+
3. Configure the middleware your ASP.NET Core app's `Program.cs`:
20+
```csharp
21+
var builder = WebApplication.CreateBuilder(args);
22+
23+
builder.Services.AddAuthentication()
24+
.AddFacebook(options =>
25+
{
26+
options.AppId = Configuration["Authentication:Facebook:AppId"];
27+
options.AppSecret = Configuration["Authentication:Facebook:AppSecret"];
28+
});
29+
```
30+
31+
## Main Types
32+
33+
The main types provided by this package are:
34+
35+
* `FacebookOptions`: Represents the options for configuring Facebook authentication
36+
* `FacebookHandler`: The authentication handler responsible for processing Facebook authentication requests and generating the appropriate authentication ticket
37+
38+
## Additional Documentation
39+
40+
For additional documentation and examples, refer to the [official documentation](https://learn.microsoft.com/aspnet/core/security/authentication/social/facebook-logins) on Facebook login setup in ASP.NET Core.
41+
42+
## Feedback & Contributing
43+
44+
`Microsoft.AspNetCore.Authentication.Facebook` 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)