rounakcodes Posted on Jun 16, 2021 10 2 Keycloak: REST API for Realm Role #keycloak #realm #authentication #authorization 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" Enter fullscreen mode Exit fullscreen mode 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>"}' Enter fullscreen mode Exit fullscreen mode Get all Realm Roles Code curl -X GET http://localhost:8080/auth/admin/realms/<realm-id>/roles \ -H "Authorization: Bearer ${TOKEN}" \ Enter fullscreen mode Exit fullscreen mode Top comments (1) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Collapse Expand Hendi Santika Hendi Santika Hendi Santika Follow I am a father and software developer. Love Coding, Software Development, Community Leader of @jvmdeveloperid, @KotlinID & @IDDevOps Email hendisantika@yahoo.co.id Location West Java - Indonesia Joined Jun 18, 2018 • Mar 10 '22 Dropdown menu Copy link Hide Report abuse Is there any way to list all realm & client roles by REST API ADMIN via Java? Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
Is there any way to list all realm & client roles by REST API ADMIN via Java?