[keycloak-user] Retrieve all accessible applications for the logged user

Denis Danov denis.danov at dreamix.eu
Mon Feb 4 03:06:58 EST 2019


Hi all,

Now I am exploring the idea to extract this data from DB. Our Keycloak
instance has federation user provider LDAP which is already synced and I
can see users and roles in KC. However on Keycloak's account page I can see
more roles assigned to a user than in DB. Is there different data provider
than the DB for Keycloak to build its mapping between user and the list of
application he can access in the account page?

Regards,
Denis

On Fri, Jan 18, 2019 at 4:30 PM Denis Danov <denis.danov at dreamix.eu> wrote:

> Hi Dmitry, Stan,
>
> thank you for the responses. We will check the custom REST API option.
> Thank you a lot about the information.
>
> On Fri, Jan 18, 2019 at 6:25 AM Dmitry Telegin <dt at acutus.pro> wrote:
>
>> Hello Denis, just my 2¢ in addition to what Stan said,
>>
>> If you can't wait for the account REST service to be merged, you can
>> create your own REST service to expose the data you need.
>>
>> Check out Server Development [1] for how to create custom REST resources,
>> BeerCloak [2] for how to secure them and ApplicationsBean.java [3] for how
>> to obtain application list.
>>
>> [1]
>> https://www.keycloak.org/docs/latest/server_development/index.html#_extensions_rest
>> [2] https://github.com/dteleguin/beercloak
>> [3]
>> https://github.com/keycloak/keycloak/blob/master/services/src/main/java/org/keycloak/forms/account/freemarker/model/ApplicationsBean.java
>>
>> Cheers,
>> Dmitry Telegin
>> CTO, Acutus s.r.o.
>> Keycloak Consulting and Training
>>
>> Pod lipami street 339/52, 130 00 Prague 3, Czech Republic
>> +42 (022) 888-30-71
>> E-mail: info at acutus.pro
>>
>> On Thu, 2019-01-17 at 14:11 +0200, Denis Danov wrote:
>> > Hi Keycloak members,
>> >
>> > I am excited writing to you and I hope someone will answer.
>> > I am working on an application that should be registered and secured in
>> > Keycloak. Once the user is authenticated we want to show list of all
>> other
>> > applications that the user has access to.
>> > Can this information be retrieved via REST API as I can see that it is
>> > already available from Keycloak UI for user's account under section
>> > applications
>> > https://www.keycloak.org/docs/3.3/server_admin/topics/account.html
>> >
>> > Regards,
>> > Denis Danov
>> > _______________________________________________
>> > keycloak-user mailing list
>> > keycloak-user at lists.jboss.org
>> > https://lists.jboss.org/mailman/listinfo/keycloak-user
>>
>


More information about the keycloak-user mailing list