1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

added licensing apis, refactored some services

This commit is contained in:
Kyle Spearrin
2017-08-30 11:23:55 -04:00
parent ccd6b784be
commit 8b947cafaf
11 changed files with 134 additions and 9 deletions

View File

@ -97,6 +97,11 @@ namespace Bit.Api
policy.RequireAuthenticatedUser();
policy.RequireClaim(JwtClaimTypes.Scope, "api.push");
});
config.AddPolicy("Licensing", policy =>
{
policy.RequireAuthenticatedUser();
policy.RequireClaim(JwtClaimTypes.Scope, "api.licensing");
});
});
services.AddScoped<AuthenticatorTokenProvider>();
@ -190,7 +195,7 @@ namespace Bit.Api
var options = new IdentityServerAuthenticationOptions
{
Authority = globalSettings.BaseServiceUri.InternalIdentity,
AllowedScopes = new string[] { "api", "api.push" },
AllowedScopes = new string[] { "api", "api.push", "api.licensing" },
RequireHttpsMetadata = !env.IsDevelopment() && globalSettings.BaseServiceUri.InternalIdentity.StartsWith("https"),
NameClaimType = ClaimTypes.Email,
// Suffix until we retire the old jwt schemes.