[keycloak-dev] Getting UserModel from inside AdminConsole.getMainPage() ?

Stan Silvert ssilvert at redhat.com
Fri Sep 11 11:22:09 EDT 2015


On 9/11/2015 11:13 AM, Stian Thorgersen wrote:
> Maybe you could add a get/set locale endpoint alongside the whoAmI endpoint? Then invoke it using Angular, which would include the access token.
Wouldn't that require changing the way the locale switcher works? You 
are talking about invoking the new endpoint after index.html is already 
rendered by Freemarker?  If so, it's too late for the locale switcher to 
be set up.
>
> ----- Original Message -----
>> From: "Stan Silvert" <ssilvert at redhat.com>
>> To: "Stian Thorgersen" <stian at redhat.com>
>> Cc: "keycloak-dev" <keycloak-dev at lists.jboss.org>
>> Sent: Friday, 11 September, 2015 5:12:11 PM
>> Subject: Re: [keycloak-dev] Getting UserModel from inside AdminConsole.getMainPage() ?
>>
>> On 9/11/2015 10:51 AM, Stian Thorgersen wrote:
>>> There's no user when getting the index.html page - it's a html5 app so the
>>> token is retrieved by the js adapter, which is after index.html is loaded.
>>>
>>> Why do you need a user there? Seems like you're doing something not right.
>> I'm trying to add the locale swticher to the main page.  The locale
>> switcher is generated via Freemarker and it needs a LocaleBean.  For
>> that, I need to call LocaleHelper.getLocale(), which requires UserInfo.
>>
>>> ----- Original Message -----
>>>> From: "Stan Silvert" <ssilvert at redhat.com>
>>>> To: "keycloak-dev" <keycloak-dev at lists.jboss.org>
>>>> Sent: Friday, 11 September, 2015 4:48:20 PM
>>>> Subject: [keycloak-dev] Getting UserModel from inside
>>>> 	AdminConsole.getMainPage() ?
>>>>
>>>> I need to get the current logged-in UserModel from inside this method:
>>>> https://github.com/keycloak/keycloak/blob/master/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java#L266
>>>>
>>>> I tried the same approach as the whoAmI() method, but
>>>> authManager.authenticateBearerToken() returns null.   I guess the token
>>>> is not set up yet?
>>>>
>>>> Any ideas on an alternate way to get UserModel?
>>>>
>>>> Stan
>>>> _______________________________________________
>>>> keycloak-dev mailing list
>>>> keycloak-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/keycloak-dev
>>>>
>>



More information about the keycloak-dev mailing list