Skip to content

Commit 2ed9f97

Browse files
authored
Update README.md
- Add language to code blocks
1 parent 63b4e83 commit 2ed9f97

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ No build so far.
4545

4646
Add something like this in the `public void ConfigureServices` method:
4747

48-
```
48+
```csharp
4949
services.AddAuthentication(
5050
options =>
5151
{
@@ -57,7 +57,7 @@ services.AddAuthentication(
5757

5858
and this to the `public void Configure` method before `app.UseMvc...`:
5959

60-
```
60+
```csharp
6161
app.UseAuthentication();
6262
```
6363

@@ -67,7 +67,7 @@ This will enable the `EasyAuthAuthenticationHandler` in your app.
6767

6868
In your controllers you can access the `User` property as usual:
6969

70-
```
70+
```csharp
7171
[Authorize]
7272
public string UserName()
7373
{
@@ -87,14 +87,14 @@ If you want to add roles to the `User` property you can have a look in `Transfor
8787

8888
You can provide additional options vor the middleware:
8989

90-
```
90+
```csharp
9191
).AddEasyAuth(
92-
options =>
93-
{
94-
// Override the default claim for the User.Identity.Name field
95-
options.NameClaimType = ClaimTypes.Email;
96-
}
97-
);
92+
options =>
93+
{
94+
// Override the default claim for the User.Identity.Name field
95+
options.NameClaimType = ClaimTypes.Email;
96+
}
97+
);
9898
```
9999

100100
The `NameClaimType` is the ClaimType of the value which one will be used to fill the `User.Identity.Name` field.
@@ -104,7 +104,7 @@ The `NameClaimType` is the ClaimType of the value which one will be used to fill
104104
For debugging your application you can place a `me.json` in the `wwwroot/.auth` folder of your web app and add some configuration to the `AddEasyAuth` call.
105105
For example:
106106

107-
```
107+
```csharp
108108
).AddEasyAuth(
109109
options =>
110110
{

0 commit comments

Comments
 (0)