wip: oauth
This commit is contained in:
@@ -41,18 +41,18 @@ builder.Services.AddAuthentication()
|
||||
}
|
||||
};
|
||||
|
||||
// b.Events = new JwtBearerEvents()
|
||||
// {
|
||||
// OnMessageReceived = (ctx) =>
|
||||
// {
|
||||
// if (ctx.Request.Query.ContainsKey("token"))
|
||||
// {
|
||||
// ctx.Token = ctx.Request.Query["token"];
|
||||
// }
|
||||
//
|
||||
// return Task.CompletedTask;
|
||||
// }
|
||||
// };
|
||||
b.Events = new JwtBearerEvents()
|
||||
{
|
||||
OnMessageReceived = (ctx) =>
|
||||
{
|
||||
if (ctx.Request.Query.ContainsKey("token"))
|
||||
{
|
||||
ctx.Token = ctx.Request.Query["token"];
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
};
|
||||
});
|
||||
builder.Services.AddAuthorization();
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
|
||||
"applicationUrl": "http://localhost:5001",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
@@ -22,8 +21,7 @@
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
|
||||
"applicationUrl": "https://localhost:5000;http://localhost:5001",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
|
||||
Reference in New Issue
Block a user