1
0
mirror of https://github.com/bitwarden/server synced 2026-01-06 18:43:36 +00:00

build jwtoptions from JwtBearerAppBuilderExtensions

This commit is contained in:
Kyle Spearrin
2017-01-21 23:35:20 -05:00
parent 220243c8b4
commit 97c14100d2
2 changed files with 9 additions and 4 deletions

View File

@@ -23,7 +23,14 @@ namespace Bit.Core.Identity
}
var jwtOptions = app.ApplicationServices.GetRequiredService<IOptions<JwtBearerIdentityOptions>>().Value;
var options = BuildJwtBearerOptions(jwtOptions);
app.UseJwtBearerAuthentication(options);
return app;
}
public static JwtBearerOptions BuildJwtBearerOptions(JwtBearerIdentityOptions jwtOptions)
{
var options = new JwtBearerOptions();
// Basic settings - signing key to validate with, audience and issuer.
@@ -53,9 +60,7 @@ namespace Bit.Core.Identity
OnMessageReceived = JwtBearerEventImplementations.MessageReceivedAsync
};
app.UseJwtBearerAuthentication(options);
return app;
return options;
}
}
}