From 7502a31421d8d80483cb840e35696dfb2634ba3f Mon Sep 17 00:00:00 2001 From: Mica Hallin Date: Tue, 16 May 2023 13:18:43 +0200 Subject: [PATCH] Ensure client secret is encoded properly in `Authorization` header (#20000) Closes #19879 --- js/libs/keycloak-admin-client/src/utils/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/libs/keycloak-admin-client/src/utils/auth.ts b/js/libs/keycloak-admin-client/src/utils/auth.ts index b552179b7b..9f9729e933 100644 --- a/js/libs/keycloak-admin-client/src/utils/auth.ts +++ b/js/libs/keycloak-admin-client/src/utils/auth.ts @@ -79,7 +79,7 @@ export const getToken = async (settings: Settings): Promise => { if (credentials.clientSecret) { headers.set( "Authorization", - atob(credentials.clientId + ":" + credentials.clientSecret) + `Basic ${btoa(`${credentials.clientId}:${credentials.clientSecret}`)}` ); }