1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

[PS-284] Allow installation clients to not need a user. (#1968)

* Allow installation clients to not need a user.

* Run formatting
This commit is contained in:
Justin Baur 2022-04-22 16:40:38 -04:00 committed by GitHub
parent 669d44c170
commit 972657f982
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,8 +57,9 @@ namespace Bit.Core.IdentityServer
public async Task ValidateAsync(CustomTokenRequestValidationContext context) public async Task ValidateAsync(CustomTokenRequestValidationContext context)
{ {
string[] allowedGrantTypes = { "authorization_code", "client_credentials" }; string[] allowedGrantTypes = { "authorization_code", "client_credentials" };
if (!allowedGrantTypes.Contains(context.Result.ValidatedRequest.GrantType) || if (!allowedGrantTypes.Contains(context.Result.ValidatedRequest.GrantType)
context.Result.ValidatedRequest.ClientId.StartsWith("organization")) || context.Result.ValidatedRequest.ClientId.StartsWith("organization")
|| context.Result.ValidatedRequest.ClientId.StartsWith("installation"))
{ {
return; return;
} }