|
1 |
| -using System; |
2 |
| -using System.Reflection; |
3 |
| -using System.Security.Claims; |
4 |
| -using Microsoft.AspNetCore.Builder; |
| 1 | +using Microsoft.AspNetCore.Builder; |
5 | 2 | using Microsoft.AspNetCore.Hosting;
|
6 | 3 | using Microsoft.AspNetCore.Http;
|
7 |
| -using Microsoft.AspNetCore.Mvc; |
8 | 4 | using Microsoft.EntityFrameworkCore;
|
9 | 5 | using Microsoft.Extensions.Configuration;
|
10 | 6 | using Microsoft.Extensions.DependencyInjection;
|
|
14 | 10 | using Skoruba.AuditLogging.EntityFramework.Extensions;
|
15 | 11 | using Skoruba.AuditLogging.Host.Consts;
|
16 | 12 | using Skoruba.AuditLogging.Host.Helpers.Authentication;
|
| 13 | +using System; |
| 14 | +using System.Reflection; |
| 15 | +using System.Security.Claims; |
17 | 16 |
|
18 | 17 | namespace Skoruba.AuditLogging.Host
|
19 | 18 | {
|
@@ -67,13 +66,13 @@ public void ConfigureServices(IServiceCollection services)
|
67 | 66 | .AddScheme<TestAuthenticationOptions, TestAuthenticationHandler>(AuthenticationConsts.Scheme,
|
68 | 67 | options =>
|
69 | 68 | {
|
70 |
| - options.Identity = new ClaimsIdentity(new[] |
71 |
| - { |
72 |
| - new Claim(AuthenticationConsts.ClaimName, "bob"), |
73 |
| - new Claim(AuthenticationConsts.ClaimSub, Guid.NewGuid().ToString()), |
74 |
| - new Claim(AuthenticationConsts.ClaimRole, Guid.NewGuid().ToString()), |
75 |
| - new Claim(AuthenticationConsts.ClaimRole, Guid.NewGuid().ToString()) |
76 |
| - }, AuthenticationConsts.AuthenticationType, AuthenticationConsts.ClaimName, AuthenticationConsts.ClaimRole); |
| 69 | + options.Identity = new ClaimsIdentity( |
| 70 | + [ |
| 71 | + new Claim(AuthenticationConsts.ClaimName, "bob"), |
| 72 | + new Claim(AuthenticationConsts.ClaimSub, Guid.NewGuid().ToString()), |
| 73 | + new Claim(AuthenticationConsts.ClaimRole, Guid.NewGuid().ToString()), |
| 74 | + new Claim(AuthenticationConsts.ClaimRole, Guid.NewGuid().ToString()) |
| 75 | + ], AuthenticationConsts.AuthenticationType, AuthenticationConsts.ClaimName, AuthenticationConsts.ClaimRole); |
77 | 76 | });
|
78 | 77 |
|
79 | 78 | services.AddControllersWithViews();
|
|
0 commit comments