Skip to content

Commit b53187c

Browse files
committed
Hashing client secret
1 parent ababba5 commit b53187c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Source/Kernel/Setup/Authentication/AuthenticationService.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,14 @@ public async Task EnsureDefaultClientCredentials()
8787

8888
logger.CreatingDefaultClientCredentials(defaultClientId);
8989

90+
// Hash the secret to match how other application secrets are stored
91+
var hashedSecret = _passwordHasher.HashPassword(null!, defaultClientSecret);
92+
9093
var application = new Application
9194
{
9295
Id = Guid.NewGuid().ToString(),
9396
ClientId = defaultClientId,
94-
ClientSecret = defaultClientSecret,
97+
ClientSecret = hashedSecret,
9598
Type = "confidential",
9699
ConsentType = "implicit",
97100
Permissions =

0 commit comments

Comments
 (0)