[keycloak-user] Retrieving the access token itself from org.keycloak.representations.AccessToken

Aritz Maeztu amaeztu at tesicnor.com
Fri Sep 30 03:04:18 EDT 2016


Ok, I was guessing that. I suppose I need to retrieve other token from 
the /auth/realms/{{realm}}/protocol/openid-connect/token endpoint, the 
way I was doing.

Thanks!


30/09/2016 9:01(e)an, Stian Thorgersen igorleak idatzi zuen:
> The access token is not created yet at that point. You can't sign 
> something that's not completed ;)
>
> A service account is the way to go, as you don't actually have a token 
> yet, you're in the progress of creating one.
>
> On 30 September 2016 at 08:38, Aritz Maeztu <amaeztu at tesicnor.com 
> <mailto:amaeztu at tesicnor.com>> wrote:
>
>     I have implemented my own mapper to add extra info in the
>     transformAccessToken method. However, to fill the extra fields I would
>     like to use the access token itself to access a remote security
>     endpoint
>     which is secured. However, I don't see any way to retrieve the base64
>     encoded token from the org.keycloak.representations.AccessToken.java
>     object.
>
>     Currently my workaround is to access the remote endpoint using a
>     service
>     account, but I would like to take advantage of the token I already
>     have.
>
>     Is it possible?
>
>
>     --
>     Aritz Maeztu Otaño
>     Departamento Desarrollo de Software
>     <https://www.linkedin.com/in/aritz-maeztu-ota%C3%B1o-65891942
>     <https://www.linkedin.com/in/aritz-maeztu-ota%C3%B1o-65891942>>
>     <http://www.tesicnor.com>
>
>     Pol. Ind. Mocholi. C/Rio Elorz, Nave 13E 31110 Noain (Navarra)
>     Telf. Aritz Maeztu: 948 68 03 06
>     Telf. Secretaría: 948 21 40 40
>
>     Antes de imprimir este e-mail piense bien si es necesario hacerlo: El
>     medioambiente es cosa de todos.
>
>     _______________________________________________
>     keycloak-user mailing list
>     keycloak-user at lists.jboss.org <mailto:keycloak-user at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/keycloak-user
>     <https://lists.jboss.org/mailman/listinfo/keycloak-user>
>
>

-- 
Aritz Maeztu Otaño
Departamento Desarrollo de Software 
<https://www.linkedin.com/in/aritz-maeztu-ota%C3%B1o-65891942>
<http://www.tesicnor.com> 	

Pol. Ind. Mocholi. C/Rio Elorz, Nave 13E 31110 Noain (Navarra)
Telf. Aritz Maeztu: 948 68 03 06
Telf. Secretaría: 948 21 40 40

Antes de imprimir este e-mail piense bien si es necesario hacerlo: El 
medioambiente es cosa de todos.



More information about the keycloak-user mailing list