[keycloak-user] Implementing Keycloak on Android

Amaeztu amaeztu at tesicnor.com
Wed May 31 17:01:21 EDT 2017


Hello Raquel, 

I handle the flow myself. Essentially what I do:

1. For every single request to be performed to a secured resource, check for the access token stored in shared preferences. If there's no access token, open the web view for the keycloak login. Otherwise, if the access token is about to expire, try to refresh it. If it can't be refreshed, launch the web view with the login. 

2. The login web view goes back to the application with a code when the login process is performed. You need to use this code from the app to retrieve the access token and store it in shared preferences. 

3. You need to include the access token in every request, in the authorization header. There are several ways to do it with no code duplication. I personally use Spring's Android rest template and it's interceptors.

Nire Sony Xperia™ telefonotik bidalita

---- Raquel Júdez Bello igorleak idatzi du ----

>Hi everyone,
>I am having trouble finding libraries to implement a Keycloak client for
>Android.
>So far, I have found AppAuth and Androgear in keycloak.org, but I am not
>convinced about their simplicity.
>
>Has anyone implemented a simple client for Android?
>Thank you very much.
>
>-- 
>Raquel Júdez.
>_______________________________________________
>keycloak-user mailing list
>keycloak-user at lists.jboss.org
>https://lists.jboss.org/mailman/listinfo/keycloak-user


More information about the keycloak-user mailing list