<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 27, 2013 at 10:16 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">And then to actually do callApi?<br>
customPipe.call({})<br></blockquote><div><br></div><div>No, then just calling our existing functions on the pipe : read, save ...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5"><br>
<br>
On Aug 27, 2013, at 10:10 AM, Sebastien Blanc &lt;<a href="mailto:scm.blanc@gmail.com">scm.blanc@gmail.com</a>&gt; wrote:<br>
<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Aug 27, 2013 at 9:56 AM, Corinne Krych &lt;<a href="mailto:corinnekrych@gmail.com">corinnekrych@gmail.com</a>&gt; wrote:<br>
&gt; Indeed it will be less intrusive to do as suggested by Seb.<br>
&gt; using something like:<br>
&gt; pipe.call({…})<br>
&gt;<br>
&gt; Well, I was more thinking using our actual API, for i.e<br>
&gt;<br>
&gt; var customPipe = AeroGear.Pipeline([{<br>
&gt;<br>
&gt;     name<br>
&gt; : &quot;customPipe&quot;,<br>
&gt;<br>
&gt;     settings<br>
&gt; : {<br>
&gt;<br>
&gt;        authenticator: thing<br>
&gt;<br>
&gt;<br>
&gt; }<br>
&gt; }]).pipes[0];<br>
&gt;<br>
&gt; Still on callAPi section where do we pass the access token? in the settings section?<br>
&gt;<br>
&gt; I think that after thing.authenticate() we don&#39;t have to worry to pass the token, it&#39;s automagically added.<br>
&gt;<br>
&gt; Coud we put the &#39;service&#39; into settings too?<br>
&gt;<br>
&gt; ++<br>
&gt; Corinne<br>
&gt;<br>
&gt; 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>
&gt;<br>
&gt; &gt; Hi,<br>
&gt; &gt; That sounds good !<br>
&gt; &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; &gt; Seb<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &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; &gt; OAuth2 AeroGear Workflow - High Level<br>
&gt; &gt;<br>
&gt; &gt; Using Google api&#39;s<br>
&gt; &gt;<br>
&gt; &gt; Server Side<br>
&gt; &gt;<br>
&gt; &gt;       • user needs to first create an &quot;application/project&quot; to get an api key<br>
&gt; &gt;       • Then they would choose the services/api&#39;s then would like there application to access<br>
&gt; &gt;       • other google server related items....<br>
&gt; &gt; Client Side<br>
&gt; &gt;<br>
&gt; &gt;       • Create a new OAuth2 module thing<br>
&gt; &gt;       • Get access token for the services would need to specify the services they would like to access<br>
&gt; &gt;       • validate the token<br>
&gt; &gt;       • make calls to the service<br>
&gt; &gt; API<br>
&gt; &gt;<br>
&gt; &gt; var thing = AerGear.OAuth2({<br>
&gt; &gt;                 name: googleEndPoints, //Just a Name<br>
&gt; &gt;                 clientID: &quot;12345&quot; //The client ID of the app from the API console<br>
&gt; &gt;                 settings: {<br>
&gt; &gt;                     permissions: &quot;..&quot;,<br>
&gt; &gt;                     ...<br>
&gt; &gt;                 }<br>
&gt; &gt;             }).somecoolmodulename.googleEndPoints;<br>
&gt; &gt;<br>
&gt; &gt; Settings: Multiple settings based on paramters here<br>
&gt; &gt;<br>
&gt; &gt; Methods<br>
&gt; &gt;<br>
&gt; &gt; authenticate<br>
&gt; &gt;<br>
&gt; &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; &gt;<br>
&gt; &gt; thing.authenticate({<br>
&gt; &gt;     success:{},<br>
&gt; &gt;     error:{},<br>
&gt; &gt;     settings: {<br>
&gt; &gt;         //probably some settings here, like URL overides and such<br>
&gt; &gt;     }<br>
&gt; &gt; });<br>
&gt; &gt;<br>
&gt; &gt; callApi<br>
&gt; &gt;<br>
&gt; &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; &gt;<br>
&gt; &gt; example:<br>
&gt; &gt;<br>
&gt; &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; &gt; or<br>
&gt; &gt;<br>
&gt; &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; &gt; code:<br>
&gt; &gt;<br>
&gt; &gt; thing.callApi({<br>
&gt; &gt;     service: &quot;userinfo&quot;, //don&#39;t really like this name either<br>
&gt; &gt;     success:{},<br>
&gt; &gt;     error:{},<br>
&gt; &gt;     settings: {<br>
&gt; &gt;         ... //overridable baseURLs?<br>
&gt; &gt;     }<br>
&gt; &gt; });<br>
&gt; &gt;<br>
&gt; &gt; revoke<br>
&gt; &gt;<br>
&gt; &gt; again, maybe not the best name. calls the &quot;revoke&quot; service, to remove access to permissions<br>
&gt; &gt;<br>
&gt; &gt; thing.revoke({<br>
&gt; &gt;     success: {},<br>
&gt; &gt;     error: {},<br>
&gt; &gt;     settings: {}<br>
&gt; &gt; });<br>
&gt; &gt;<br>
&gt; &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; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &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; &gt;<br>
&gt; &gt;&gt; +1 I think is a good start to us.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Kris Borchers wrote:<br>
&gt; &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;&gt;<br>
&gt; &gt;&gt; --<br>
&gt; &gt;&gt; abstractj<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; _______________________________________________<br>
&gt; &gt;&gt; aerogear-dev mailing list<br>
&gt; &gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt; &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; &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; &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>