<div dir="ltr">+1 on this</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 9, 2015 at 2:42 PM, Bruno Oliveira <span dir="ltr"><<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Good morning, while writing our quickstarts, I found something that I<br>
would like to change.<br>
<br>
Currently to setup our OAuth2 providers we have to do something like<br>
this:<br>
<br>
AuthorizationManager.config(MODULE_NAME, OAuth2AuthorizationConfiguration.class)<br>
.setBaseURL(new URL("https://"))<br>
.setAuthzEndpoint(AUTHZ_ENDPOINT)<br>
.setAccessTokenEndpoint(AUTHZ_TOKEN_ENDPOINT)<br>
.setAccountId(AUTHZ_ACCOOUNT_ID)<br>
.setClientId(AUTHZ_CLIENT_ID)<br>
.setClientSecret(AUTHZ_CLIENT_SECRET)<br>
.setRedirectURL(AUTHZ_REDIRECT_URL)<br>
.setRefreshEndpoint(AUTHZ_TOKEN_ENDPOINT)<br>
.addAdditionalAccessParam(Pair.create("response_type", "code"))<br>
.setScopes(Arrays.asList("photo_upload, publish_actions"))<br>
.asModule();<br>
<br>
Although, things like the url endpoint, access token endpoint, or the<br>
module will most of time remain unchanged. Unless you switch from Facebook to<br>
Keycloak for example. People don't care that much about these<br>
urls, but which provider they want to connect.<br>
<br>
So I would like to refactor the authz module from AGDroid, define the default values<br>
for ommitted params and make the methods like setBaseURL for example,<br>
alternative. Something like this:<br>
<br>
AuthorizationManager.config(MODULE_NAME, OAuth2AuthorizationConfiguration.class)<br>
.setClientId(AUTHZ_CLIENT_ID)<br>
.setClientSecret(AUTHZ_CLIENT_SECRET)<br>
.asModule();<br>
<br>
Based on the module name, we instantiate the respective module with the<br>
default values already in.<br>
<br>
Thoughts? Let me know if the idea is useless.<br>
<br>
<br>
--<br>
<br>
abstractj<br>
PGP: 0x84DC9914<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>