mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 01:22:50 -05:00
[SM-678] ClientSecret migration (#2943)
* Init ClientSecret migration * Fix unit tests * Move to src/Sql/dbo_future * Formatting changes * Update migration date for next release * Swap to just executing sp_refreshview * Fix formatting * Add EF Migrations * Rename to ClientSecretHash * Fix unit test * EF column rename * Batch the migration * Fix formatting * Add deprecation notice to property * Move data migration * Swap to CREATE OR ALTER
This commit is contained in:
@ -107,11 +107,16 @@ public class ClientStore : IClientStore
|
||||
break;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(apiKey.ClientSecretHash))
|
||||
{
|
||||
apiKey.ClientSecretHash = apiKey.ClientSecret.Sha256();
|
||||
}
|
||||
|
||||
var client = new Client
|
||||
{
|
||||
ClientId = clientId,
|
||||
RequireClientSecret = true,
|
||||
ClientSecrets = { new Secret(apiKey.ClientSecret.Sha256()) },
|
||||
ClientSecrets = { new Secret(apiKey.ClientSecretHash) },
|
||||
AllowedScopes = apiKey.GetScopes(),
|
||||
AllowedGrantTypes = GrantTypes.ClientCredentials,
|
||||
AccessTokenLifetime = 3600 * 1,
|
||||
|
Reference in New Issue
Block a user