mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 23:47:28 +00:00
test(keycloak): fix Keycloak OIDC live fixture (#6563)
This commit is contained in:
@@ -27,6 +27,8 @@
|
|||||||
{
|
{
|
||||||
"id": "00000000-0000-0000-0000-000000000001",
|
"id": "00000000-0000-0000-0000-000000000001",
|
||||||
"username": "alice",
|
"username": "alice",
|
||||||
|
"firstName": "Alice",
|
||||||
|
"lastName": "RustFS",
|
||||||
"email": "alice@example.test",
|
"email": "alice@example.test",
|
||||||
"emailVerified": true,
|
"emailVerified": true,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
|||||||
@@ -128,14 +128,17 @@ token_for_client() {
|
|||||||
local client_id="$1"
|
local client_id="$1"
|
||||||
local client_secret="$2"
|
local client_secret="$2"
|
||||||
local response_file="${WORK_DIR}/token-${client_id}.json"
|
local response_file="${WORK_DIR}/token-${client_id}.json"
|
||||||
curl --noproxy '*' -fsS "${ISSUER}/protocol/openid-connect/token" \
|
if ! curl --noproxy '*' -sS --fail-with-body "${ISSUER}/protocol/openid-connect/token" \
|
||||||
--data-urlencode grant_type=password \
|
--data-urlencode grant_type=password \
|
||||||
--data-urlencode "client_id=${client_id}" \
|
--data-urlencode "client_id=${client_id}" \
|
||||||
--data-urlencode "client_secret=${client_secret}" \
|
--data-urlencode "client_secret=${client_secret}" \
|
||||||
--data-urlencode username=alice \
|
--data-urlencode username=alice \
|
||||||
--data-urlencode password=alice-password \
|
--data-urlencode password=alice-password \
|
||||||
--data-urlencode scope=openid \
|
--data-urlencode scope=openid \
|
||||||
>"${response_file}"
|
>"${response_file}"; then
|
||||||
|
cat "${response_file}" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
python3 - "${response_file}" "${ISSUER}" "${client_id}" <<'PY'
|
python3 - "${response_file}" "${ISSUER}" "${client_id}" <<'PY'
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
|
|||||||
Reference in New Issue
Block a user