<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 15, 2014 at 5:28 PM, Bruno Oliveira <span dir="ltr">&lt;<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span>Amazing Summers! Please turn this list of thing into Jiras if possible.</span></blockquote><div><br></div><div>late reply :-)</div><div><br></div><div><br></div><div>+1 I really like that - let&#39;s make sure we track that with JIRA - this _IS_ A really cool feature and does add a lot of value for our OAuth/KC bits!</div><div><br></div><div>-Matthias</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>—<br>abstractj <br>PGP: 0x84DC9914 </div><div class="HOEnZb"><div class="h5">
<br><br><div class="gmail_quote"><p>On Mon, Sep 15, 2014 at 11:36 AM, Summers Pittman <span dir="ltr">&lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt;</span> wrote:<br></p><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>&lt;tldr&gt;DEVELOPERS WILL NEVER HAVE TO WRITE ANOTHER LINE OF AUTH LOGIC 
<br>AGAIN!&lt;/tldr&gt;
<br><br>Over the weekend I tried my hand at writing a Android Account 
<br>Authenticator for KeyCloak.  This lets Android manage the KeyCloak 
<br>account, fetch tokens, provide tokens to other apps etc.  KeyCloak 
<br>Authenticator let&#39;s you drop your keycloak.json file into an apk and 
<br>access your KeyCloak Account with one line of code from any application 
<br>on your Android device.
<br><br>Right now this is very much in the &quot;I have an itch needing scratching&quot; 
<br>phase.  It doesn&#39;t do any robust error handling, hasn&#39;t been testing off 
<br>the golden scenario, has no integration with any of the AeroGear stuff, 
<br>etc.  Take a moment to watch the Demo and look at the demo project.
<br><br>  Video Demo : 
<br><a href="https://plus.google.com/103442292643366117394/posts/WSFbdodMsej" target="_blank">https://plus.google.com/103442292643366117394/posts/WSFbdodMsej</a>
<br><br>The Demo video uses Android&#39;s native account menu to request from the 
<br>authenticator a KeyCloak account.  This launches the authenticator&#39;s 
<br>activity which will retrieve the credentials for Android and store 
<br>them.  When I am back in the settings page and showing off the stored 
<br>account, this is all native Android UI and not part of the KeyCloak 
<br>authenticator.
<br><br>When I launch the Demo application this is a separate application from 
<br>the authenticator apk.  The Demo project fetches the KeyCloak account 
<br>from Android and gets its auth token.  Then it makes a request to 
<br>KeyCloak&#39;s account service to fetch the user&#39;s account data.
<br><br>In the demo app there are three lines of code related to auth.
<br><br>   final Account account = am.getAccountsByType(&quot;org.keycloak.Account&quot;)[0];
<br>   String token = am.getAuthToken(account, &quot;org.keycloak.Account.token&quot;, 
<br>null, null, null, null).getResult().getString(AccountManager.KEY_AUTHTOKEN);
<br><br>and
<br><br>provider.setDefaultHeader(&quot;Authorization&quot;, &quot;bearer &quot; + token);
<br><br>The first two lines fetch the account and token from Android.  The 
<br>second line attaches the account&#39;s auth token to the web request to the 
<br>server.
<br><br>So now what?  I&#39;ll probably use this for my projects/demos because it 
<br>makes my work easier.  Right now it doesn&#39;t have any connection to any 
<br>of the &quot;official&quot; projects (Again, I wrote this over the weekend to see 
<br>if I could) however it may be quite useful to someone.  In the project&#39;s 
<br>README I&#39;ve included a (incomplete) list of things that don&#39;t work.
<br><br>wdyt?
<br><br>Links :
<br>  Project : <a href="https://github.com/secondsun/keycloak-android-authenticator" target="_blank">https://github.com/secondsun/keycloak-android-authenticator</a>
<br>  Video Demo : 
<br><a href="https://plus.google.com/103442292643366117394/posts/WSFbdodMsej" target="_blank">https://plus.google.com/103442292643366117394/posts/WSFbdodMsej</a>
<br>  Demo Source : 
<br><a href="https://github.com/secondsun/keycloak-account-authenticator-demo/" target="_blank">https://github.com/secondsun/keycloak-account-authenticator-demo/</a>
<br><br><br>-- 
<br>Summers Pittman
<br>&gt;&gt;Phone:404 941 4698
<br>&gt;&gt;Java is my crack.
<br><br>_______________________________________________
<br>aerogear-dev mailing list
<br><a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a>
<br><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a>
<br></p></blockquote></div><br></div></div><br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a></div>
</div></div>