In Keycloak, Is there a way to access user roles in a theme?

Discussão em 'StackOverflow' iniciado por Stack, Fevereiro 3, 2021.

  1. Stack

    Stack Membro Participativo

    I've built a custom KeyCloak theme, and I'd like to add a menu based on the logged-in users' realmRoles.

    I haven't been able to figure out how to access roles from within the .ftl files, and documentation seems non-existent.

    Ideally, I'd be able to access them like this (within the .ftl file)

    <#list user.realmRoles as roles>
    ... do something with roles
    </#list>


    I expect there's an easy way to get a handle on this, but I haven't been able to find it in the docs. Any help would be appreciated!

    Continue reading...

Compartilhe esta Página