Maybe you could add a get/set locale endpoint alongside the whoAmI endpoint? Then invoke
it using Angular, which would include the access token.
----- Original Message -----
From: "Stan Silvert" <ssilvert(a)redhat.com>
To: "Stian Thorgersen" <stian(a)redhat.com>
Cc: "keycloak-dev" <keycloak-dev(a)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(a)redhat.com>
>> To: "keycloak-dev" <keycloak-dev(a)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/o...
>>
>> 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(a)lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/keycloak-dev
>>