Skip to content

Commit

Permalink
Add additional notes to the doc. Fix quarkusio#32143.
Browse files Browse the repository at this point in the history
  • Loading branch information
SetoKaiba authored and bschuhmann committed Nov 16, 2024
1 parent 1e71bff commit 5fe1fa0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/src/main/asciidoc/security-keycloak-authorization.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,21 @@ export access_token=$(\
)
----
[NOTE]
====
When the `quarkus.oidc.authentication.user-info-required` property is set to `true` to require that an access token is used to request `UserInfo`, you must add a `scope=openid` query parameter to the token grant request command, for example:
[source,bash]
----
export access_token=$(\
curl --insecure -X POST http://localhost:8180/realms/quarkus/protocol/openid-connect/token \
--user backend-service:secret \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'username=alice&password=alice&grant_type=password&scope=openid' | jq --raw-output '.access_token' \
)
----
====
The preceding example obtains an access token for user `alice`.
Any user is allowed to access the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,21 @@ export access_token=$(\
----
====

[NOTE]
====
When the `quarkus.oidc.authentication.user-info-required` property is set to `true` to require that an access token is used to request `UserInfo`, you must add a `scope=openid` query parameter to the token grant request command, for example:
[source,bash]
----
export access_token=$(\
curl --insecure -X POST http://localhost:8180/realms/quarkus/protocol/openid-connect/token \
--user backend-service:secret \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'username=alice&password=alice&grant_type=password&scope=openid' | jq --raw-output '.access_token' \
)
----
====

The preceding example obtains an access token for the user `alice`.

* Any user can access the `http://localhost:8080/api/users/me` endpoint, which returns a JSON payload with details about the user.
Expand Down

0 comments on commit 5fe1fa0

Please sign in to comment.