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

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


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