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

implement useapi and apikey

This commit is contained in:
Kyle Spearrin
2019-03-02 15:09:33 -05:00
parent 66729fec3f
commit 15cb0ad4c3
11 changed files with 39 additions and 8 deletions

View File

@ -87,11 +87,11 @@ namespace Bit.Core.IdentityServer
{
ClientId = $"organization.{org.Id}",
RequireClientSecret = true,
ClientSecrets = { new Secret("secret".Sha256()) }, // TODO: org.ApiKey
ClientSecrets = { new Secret(org.ApiKey.Sha256()) },
AllowedScopes = new string[] { "api.organization" },
AllowedGrantTypes = GrantTypes.ClientCredentials,
AccessTokenLifetime = 3600 * 1,
Enabled = org.Enabled, // TODO: && org.UseApi
Enabled = org.Enabled && org.UseApi,
Claims = new List<Claim> { new Claim(JwtClaimTypes.Subject, org.Id.ToString()) }
};
}