Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 16, 2021 11:34 am GMT

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:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To