Skip to content

Commit 8e3943a

Browse files
committed
feat: change password auth request
1 parent 44e6d59 commit 8e3943a

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

content/deploy/get-keycloak-token.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,16 @@ curl -X POST "https://<KEYCLOAK_HOST>/realms/<REALM_NAME>/protocol/openid-connec
1818
-d "client_secret=<CLIENT_SECRET>"
1919
```
2020

21-
If the `grant_type` is set for password authentication, you can get a bearer with the following request:
21+
If the `grant_type` is set for password authentication the request will also require a username and password:
2222

2323
```shell
24-
USERNAME=backups@libremfg.com \
25-
&& PASSWORD=password \
26-
&& curl --location \
27-
--request POST "${BAAS_OIDC_URL}/realms/libre/protocol/openid-connect/token" \
28-
--header 'Content-Type\ application/x-www-form-urlencoded' \
29-
--data-urlencode 'grant_type=password' \
30-
--data-urlencode "username=${USERNAME}" \
31-
--data-urlencode "password=${PASSWORD}" \
32-
--data-urlencode "client_id=${BAAS_OIDC_CLIENT_ID}" \
33-
--data-urlencode "client_secret=${OIDC_SECRET}" | jq .access_token
24+
curl -X POST "https://<KEYCLOAK_HOST>/realms/<REALM_NAME>/protocol/openid-connect/token" \
25+
-H "Content-Type: application/x-www-form-urlencoded" \
26+
-d "grant_type=password" \
27+
-d "client_id=<CLIENT_ID>" \
28+
-d "client_secret=<CLIENT_SECRET>" \
29+
-d "username=<USERNAME>" \
30+
-d "password=<PASSWORD>"
3431
```
3532

3633
## Response

0 commit comments

Comments
 (0)