<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 27, 2013 at 9:56 AM, Corinne Krych <span dir="ltr">&lt;<a href="mailto:corinnekrych@gmail.com" target="_blank">corinnekrych@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Indeed it will be less intrusive to do as suggested by Seb.<br>

using something like:<br>
pipe.call({…})<br></blockquote><div><br></div><div>Well, I was more thinking using our actual API, for i.e</div><div><br></div><div><span class="" style="color:rgb(137,89,168);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">var</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre"> customPipe </span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">=</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre"> </span><span class="" style="color:rgb(66,113,174);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">AeroGear</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">.</span><span class="" style="color:rgb(66,113,174);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">Pipeline</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">([{</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">
    name</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">:</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre"> </span><span class="" style="color:rgb(113,140,0);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">&quot;customPipe&quot;</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">,</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">
    settings</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">:</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre"> </span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">{</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">
       authenticator: thing</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">
    </span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">}</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">
</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">}]).</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">pipes</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">[</span><span class="" style="color:rgb(245,135,31);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">0</span><span class="" style="color:rgb(77,77,76);font-family:Consolas,&#39;Lucida Console&#39;,Monaco,monospace;font-size:14px;line-height:18px;white-space:pre">];</span><br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Still on callAPi section where do we pass the access token? in the settings section?<br></blockquote><div><br></div><div>I think that after thing.authenticate() we don&#39;t have to worry to pass the token, it&#39;s automagically added.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Coud we put the &#39;service&#39; into settings too?<br>
<br>
++<br>
<span class=""><font color="#888888">Corinne<br>
</font></span><div class=""><div class="h5"><br>
On Aug 27, 2013, at 9:39 AM, Sebastien Blanc &lt;<a href="mailto:scm.blanc@gmail.com">scm.blanc@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hi,<br>
&gt; That sounds good !<br>
&gt; Just one question, instead of using the callApi function couldn&#39;t we pass the oauth module (called &#39;thing&#39; in your example) to the pipe directly, using the &#39;authenticator&#39; setting. Behind the scene, the pipe manager will append the oauth token to the query or add the bearer header ?<br>

&gt; Seb<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Aug 26, 2013 at 8:05 PM, Lucas Holmquist &lt;<a href="mailto:lholmqui@redhat.com">lholmqui@redhat.com</a>&gt; wrote:<br>
&gt; OAuth2 AeroGear Workflow - High Level<br>
&gt;<br>
&gt; Using Google api&#39;s<br>
&gt;<br>
&gt; Server Side<br>
&gt;<br>
&gt;       • user needs to first create an &quot;application/project&quot; to get an api key<br>
&gt;       • Then they would choose the services/api&#39;s then would like there application to access<br>
&gt;       • other google server related items....<br>
&gt; Client Side<br>
&gt;<br>
&gt;       • Create a new OAuth2 module thing<br>
&gt;       • Get access token for the services would need to specify the services they would like to access<br>
&gt;       • validate the token<br>
&gt;       • make calls to the service<br>
&gt; API<br>
&gt;<br>
&gt; var thing = AerGear.OAuth2({<br>
&gt;                 name: googleEndPoints, //Just a Name<br>
&gt;                 clientID: &quot;12345&quot; //The client ID of the app from the API console<br>
&gt;                 settings: {<br>
&gt;                     permissions: &quot;..&quot;,<br>
&gt;                     ...<br>
&gt;                 }<br>
&gt;             }).somecoolmodulename.googleEndPoints;<br>
&gt;<br>
&gt; Settings: Multiple settings based on paramters here<br>
&gt;<br>
&gt; Methods<br>
&gt;<br>
&gt; authenticate<br>
&gt;<br>
&gt; this will authenticate with the server to get the access token and then validate the token, once that is all good then the response is returned.<br>
&gt;<br>
&gt; thing.authenticate({<br>
&gt;     success:{},<br>
&gt;     error:{},<br>
&gt;     settings: {<br>
&gt;         //probably some settings here, like URL overides and such<br>
&gt;     }<br>
&gt; });<br>
&gt;<br>
&gt; callApi<br>
&gt;<br>
&gt; not really a good name, but it would basically call the remote api/services. we could either do a query string option or a Head option<br>
&gt;<br>
&gt; example:<br>
&gt;<br>
&gt; curl &#39;<a href="https://www.googleapis.com/oauth2/v1/userinfo?access_token=1/fFBGRNJru1FQd44AzqT3Zg" target="_blank">https://www.googleapis.com/oauth2/v1/userinfo?access_token=1/fFBGRNJru1FQd44AzqT3Zg</a>&#39;<br>

&gt; or<br>
&gt;<br>
&gt; curl -H &quot;Authorization: Bearer {accessToken}&quot; <a href="https://www.googleapis.com/oauth2/v1/userinfo" target="_blank">https://www.googleapis.com/oauth2/v1/userinfo</a><br>
&gt; code:<br>
&gt;<br>
&gt; thing.callApi({<br>
&gt;     service: &quot;userinfo&quot;, //don&#39;t really like this name either<br>
&gt;     success:{},<br>
&gt;     error:{},<br>
&gt;     settings: {<br>
&gt;         ... //overridable baseURLs?<br>
&gt;     }<br>
&gt; });<br>
&gt;<br>
&gt; revoke<br>
&gt;<br>
&gt; again, maybe not the best name. calls the &quot;revoke&quot; service, to remove access to permissions<br>
&gt;<br>
&gt; thing.revoke({<br>
&gt;     success: {},<br>
&gt;     error: {},<br>
&gt;     settings: {}<br>
&gt; });<br>
&gt;<br>
&gt; Behind the scenes on all these calls, the &quot;access_token&quot; is beining used and possibly refreshed for the user, so they don&#39;t have to worry about it. They just need to call authenticate first. Maybe we can have a refresh method if the user wants to refresh the tokens themselves. this would do the token &quot;dance&quot;<br>

&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Aug 26, 2013, at 1:35 PM, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; +1 I think is a good start to us.<br>
&gt;&gt;<br>
&gt;&gt; Kris Borchers wrote:<br>
&gt;&gt;&gt; I would like to see that but what you are saying makes sense. It sounds like where I was headed with the Basic and Digest adapters before I ran into browser security issues with headers. I think and authorization API that basically just wraps itself around secured endpoints works for me.<br>

&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; abstractj<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; aerogear-dev mailing list<br>
&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; aerogear-dev mailing list<br>
&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
<br>
<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>
</div></div></blockquote></div><br></div></div>