Skip to content

Commit d0675b5

Browse files
Provide Microsoft.AspNetCore.Authentication.MicrosoftAccount package README (#57808)
1 parent 07f6a48 commit d0675b5

File tree

1 file changed

+42
-0
lines changed
  • src/Security/Authentication/MicrosoftAccount/src

1 file changed

+42
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## About
2+
3+
`Microsoft.AspNetCore.Authentication.MicrosoftAccount` provides ASP.NET Core middleware that enables applications to support the Microsoft Account authentication workflow.
4+
5+
## How to Use
6+
7+
To use `Microsoft.AspNetCore.Authentication.MicrosoftAccount`, follow these steps:
8+
9+
### Installation
10+
11+
```shell
12+
dotnet add package Microsoft.AspNetCore.Authentication.MicrosoftAccount
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/microsoft-logins#create-the-app-in-microsoft-developer-portal) to create the app in Microsoft Developer Portal
18+
2. Follow the steps in the official documentation [here](https://learn.microsoft.com/aspnet/core/security/authentication/social/microsoft-logins#store-the-microsoft-client-id-and-secret) to store the Microsoft 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().AddMicrosoftAccount(microsoftOptions =>
24+
{
25+
microsoftOptions.ClientId = builder.Configuration["Authentication:Microsoft:ClientId"];
26+
microsoftOptions.ClientSecret = builder.Configuration["Authentication:Microsoft:ClientSecret"];
27+
});
28+
```
29+
30+
## Main Types
31+
32+
The main types provided by this package are:
33+
* `MicrosoftAccountOptions`: Represents the options for configuring Microsoft Account authentication
34+
* `MicrosoftAccountHandler`: The authentication handler responsible for processing Microsoft Account authentication requests and generating the appropriate authentication ticket
35+
36+
## Additional Documentation
37+
38+
For additional documentation and examples, refer to the [official documentation](https://learn.microsoft.com/aspnet/core/security/authentication/social/microsoft-logins) on Microsoft Account login setup in ASP.NET Core.
39+
40+
## Feedback & Contributing
41+
42+
`Microsoft.AspNetCore.Authentication.MicrosoftAccount` 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)