|
1 | 1 | using System; |
2 | | -using Microsoft.AspNetCore.Authentication.JwtBearer; |
3 | 2 | using Microsoft.AspNetCore.Builder; |
4 | 3 | using Microsoft.AspNetCore.Hosting; |
5 | | -using Microsoft.AspNetCore.Mvc.Formatters; |
6 | 4 | using Microsoft.EntityFrameworkCore; |
7 | 5 | using Microsoft.Extensions.Configuration; |
8 | 6 | using Microsoft.Extensions.DependencyInjection; |
|
11 | 9 | using SimpleToDoService.Context; |
12 | 10 | using SimpleToDoService.Middleware; |
13 | 11 | using SimpleToDoService.Repository; |
14 | | -using System.Linq; |
15 | | -using System.Security.Claims; |
16 | | -using System.Threading.Tasks; |
17 | 12 |
|
18 | 13 | namespace SimpleToDoService |
19 | 14 | { |
@@ -61,20 +56,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF |
61 | 56 | app.UseDeveloperExceptionPage(); |
62 | 57 | } |
63 | 58 |
|
64 | | - //app.UseMiddleware<BasicAuthMiddleware>(); |
65 | | - |
66 | 59 | app.UseJwtBearerAuthentication(new JwtBearerOptions |
67 | 60 | { |
68 | | - //Events = new JwtBearerEvents() |
69 | | - //{ |
70 | | - // OnTokenValidated = (arg) => |
71 | | - // { |
72 | | - |
73 | | - // var userId = arg.HttpContext.User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier).Value; |
74 | | - // arg.HttpContext.Items.Add("UserUuid", userId); |
75 | | - // return Task.FromResult(0); |
76 | | - // } |
77 | | - //}, |
78 | 61 | AutomaticAuthenticate = true, |
79 | 62 | Authority = "https://securetoken.google.com/simpletaskmanager-9c565", |
80 | 63 | TokenValidationParameters = new TokenValidationParameters |
|
0 commit comments