[keycloak-user] Retrieving Logged In User Information.

pkkamos pkkamos at gmail.com
Fri Feb 5 04:57:33 EST 2016


Yes to both questions.
On 5 Feb 2016 09:53, "Stian Thorgersen" <sthorger at redhat.com> wrote:

> Did you actually add @SecurityDomain("keycloak")?
>
> Does the request require authentication (does it have a
> security-constraint in web.xml)?
>
> On 5 February 2016 at 10:41, PAA KOJO KONDUAH AMOS <pkkamos at gmail.com>
> wrote:
>
>> Hello, I am trying to retrieve information about the User logged into the
>> webapp via keycloak. I have seen around information on using the following;
>>
>>
>>
>> *@SecurityDomain("keycloak")*
>>
>>
>>
>> *@Context*
>>
>> *SecurityContext** sc**;*
>>
>>
>>
>> And
>>
>> *KeycloakPrincipal principal = (KeycloakPrincipal) sc.getUserPrincipal();*
>>
>>
>>
>>
>>
>>
>>
>> *But the above line is returning a NullPointerException**.*
>>
>>
>>
>> I must say, I have already done the required configuration; as in enabling
>> the Keycloak Subsystem within my app server's server configuration:
>> standalone.xml.
>>
>> Please any lead on how to retrieve the logged in User via KeyCloak?
>>
>>
>>
>>
>>
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
>> Windows 10
>>
>>
>>
>> _______________________________________________
>> keycloak-user mailing list
>> keycloak-user at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/keycloak-user
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160205/9452a245/attachment.html 


More information about the keycloak-user mailing list