An Interest In:
Web News this Week
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
- March 26, 2024
June 16, 2021 11:34 am GMT
Original Link: https://dev.to/rounakcodes/keycloak-rest-api-for-realm-role-5hgp
Keycloak: REST API for Realm Role
Get access token
- Code
curl \ -d "client_id=admin-cli" \ -d "username=admin" \ -d "password=admin" \ -d "grant_type=password" \ "http://localhost:8080/auth/realms/master/protocol/openid-connect/token"
Create a Realm Role
- Code
curl -X POST http://localhost:8080/auth/admin/realms/<realm-id>/roles \ -H "Authorization: Bearer ${TOKEN}" \ -H 'Content-Type: application/json' \ -d '{"name": "<role-name>"}'
Get all Realm Roles
- Code
curl -X GET http://localhost:8080/auth/admin/realms/<realm-id>/roles \ -H "Authorization: Bearer ${TOKEN}" \
Original Link: https://dev.to/rounakcodes/keycloak-rest-api-for-realm-role-5hgp
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To