<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 09/15/2014 11:28 AM, Bruno Oliveira
wrote:<br>
</div>
<blockquote cite="mid:1410794889840.059d9964@Nodemailer" type="cite">
<span id="mailbox-conversation">Amazing Summers! Please turn this
list of thing into Jiras if possible.</span></blockquote>
<br>
Probably will. I need to figure out what this even belongs to
(AeroGear, KeyCloak etc) and then get it hosted there.<br>
I suppose a cage match between bburke and matzew is in order ;)<br>
<br>
<blockquote cite="mid:1410794889840.059d9964@Nodemailer" type="cite">
<div class="mailbox_signature">—<br>
abstractj <br>
PGP: 0x84DC9914 </div>
<br>
<br>
<div class="gmail_quote">
<p>On Mon, Sep 15, 2014 at 11:36 AM, Summers Pittman <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>></span>
wrote:<br>
</p>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex;">
<p><tldr>DEVELOPERS WILL NEVER HAVE TO WRITE ANOTHER
LINE OF AUTH LOGIC <br>
AGAIN!</tldr>
<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'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 "I have an itch needing
scratching" <br>
phase. It doesn't do any robust error handling, hasn'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 class="moz-txt-link-freetext" href="https://plus.google.com/103442292643366117394/posts/WSFbdodMsej">https://plus.google.com/103442292643366117394/posts/WSFbdodMsej</a>
<br>
<br>
The Demo video uses Android's native account menu to request
from the <br>
authenticator a KeyCloak account. This launches the
authenticator'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's account service to fetch the user'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("org.keycloak.Account")[0];
<br>
String token = am.getAuthToken(account,
"org.keycloak.Account.token", <br>
null, null, null,
null).getResult().getString(AccountManager.KEY_AUTHTOKEN);
<br>
<br>
and
<br>
<br>
provider.setDefaultHeader("Authorization", "bearer " +
token);
<br>
<br>
The first two lines fetch the account and token from
Android. The <br>
second line attaches the account's auth token to the web
request to the <br>
server.
<br>
<br>
So now what? I'll probably use this for my projects/demos
because it <br>
makes my work easier. Right now it doesn't have any
connection to any <br>
of the "official" 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's <br>
README I've included a (incomplete) list of things that
don't work.
<br>
<br>
wdyt?
<br>
<br>
Links :
<br>
Project :
<a class="moz-txt-link-freetext" href="https://github.com/secondsun/keycloak-android-authenticator">https://github.com/secondsun/keycloak-android-authenticator</a>
<br>
Video Demo : <br>
<a class="moz-txt-link-freetext" href="https://plus.google.com/103442292643366117394/posts/WSFbdodMsej">https://plus.google.com/103442292643366117394/posts/WSFbdodMsej</a>
<br>
Demo Source : <br>
<a class="moz-txt-link-freetext" href="https://github.com/secondsun/keycloak-account-authenticator-demo/">https://github.com/secondsun/keycloak-account-authenticator-demo/</a>
<br>
<br>
<br>
-- <br>
Summers Pittman
<br>
>>Phone:404 941 4698
<br>
>>Java is my crack.
<br>
<br>
_______________________________________________
<br>
aerogear-dev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>
<br>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a>
<br>
</p>
</blockquote>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
aerogear-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Summers Pittman
>>Phone:404 941 4698
>>Java is my crack.
</pre>
</body>
</html>