... and the devil is in the details.
It seems as though all the current AuzthzModules use an http based
approach to requesting an Oauth2 token. I see this being done in
OAuth2WebFragmentFetchAutorization#doAuthorization method, where
an OAuthWebViewDialog is used to trigger the Oauth2 token request.
To use Google Play services to trigger an Oauth2 token request, we
won't use an http approach, but rather we start an activity to
select an account and request an Oauth2 token. Once the token is
retrieved it can then be used with the standard http Oauth2 API.
(One caveat: the google play services token response doesn't
provide a refresh token. I believe this to be a non-issue as the
token request process is trivial when using google play services
(no authentication step)).
I see to ways to implement this feature:
1) Generalize the OAuth2WebFragmentFetchAutorization into an
interface, and have one implementation to handle http-based token
requests, and second implementation to handle intent-based token
requests.
2) Add a OAuth2AuthorizationConfiguration option to use intents
instead of http, and trigger a different workflow within the
OAuth2WebFragmentFetchAutorization#doAuthorization method if that
config is set.
My preference is for 2) because it's a) simpler, and b) it is
really only during the #doAuthorization method that we have a
different approach.
Thoughts? I'll start with implementing approach (2) unless I hear
otherwise.
Brian
On 2015-02-24 07:25 PM, Matthias Wessendorf wrote:
On Wednesday, February 25, 2015, Daniel Passos <daniel@passos.me>
wrote:
No, we are not using Google Play services API for
now for OAuth2 in Android land.
But feel free create a new AuthzModule[1] for it ;)
+1
--
Sent from Gmail Mobile
_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev