docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:24.0.4 start-dev
- Create confidential client
test
(no special settings) - Create public client
front
(no special settings) - Create user in KC with username
abc
and set NON TEMPORARY password for himabc
- Get KC token
curl --request POST \
--url http://localhost:8080/realms/master/protocol/openid-connect/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data client_id=front \
--data username=abc \
--data password=abc \
--data grant_type=password
- Try API
curl --request GET \
--url http://localhost:5236/ \
--header 'Authorization: Bearer TAKE_ACCESS_TOKEN_FROM_ABOVE'
- Response:
Hello abc!