8000 Pass URL without trailing slashes to admin client by jonkoops · Pull Request #218 · keycloak/keycloak-js · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions test/support/admin-client.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import AdminClient from '@keycloak/keycloak-admin-client'
import { ADMIN_PASSWORD, ADMIN_USERNAME, AUTH_SERVER_URL } from './common.ts'

export const adminClient = new AdminClient({
baseUrl: AUTH_SERVER_URL.toString()
})
// Trailing slashes can cause issues with requests from the Admin Client.
// See: https://github.com/keycloak/keycloak/issues/44269
const authServerUrl = AUTH_SERVER_URL.toString()
const baseUrl = authServerUrl.endsWith('/') ? authServerUrl.slice(0, -1) : authServerUrl

export const adminClient = new AdminClient({ baseUrl })

await adminClient.auth({
username: ADMIN_USERNAME,
Expand Down
0