<div dir="ltr">Hi Tom,<div><br></div><div>thanks so much for taking time to answer my question. As far as I understand, you describe the login procedure laid out in <a href="http://doc.arvados.org/api/tokens.html">http://doc.arvados.org/api/tokens.html</a>.</div><div><br></div><div>The core of my question actually concerns navigating to <a href="https://your-apiserver-host/login?return_to=https://your-application-host/any/desired/path" rel="noreferrer" target="_blank" style="font-size:12.8px">https://your-apiserver-host/<wbr>login</a>. Am I right that this <i>requires </i>an actual <i>web browser</i> like Internet Explorer or Chrome? I am calling the API from a C# application without a UI or Web Browser, so ideally I would like to be able to log in without actually displaying a web page in an actual browser once I got the username and password, e.g. on the command line or a simple .net GUI. Do you see a way to do this? </div><div>I saw the suggestion in the documentation to copy-paste the token from the work bench to the command line to define an environment variable, but that does not seem appropriate for our users. Other APIs offer the option to pass <a href="https://your-apiserver-host/login?return_to=https://your-application-host/any/desired/path" rel="noreferrer" target="_blank" style="font-size:12.8px">https://your-apiserver-host/<wbr>login</a>/?username=XXX?password=XXX, but it seems like Arvados purposely does not allow this possibility. </div><div><br></div><div>Best regards</div><div><br></div><div>Thomas</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 18, 2017 at 10:22 PM, Tom Clegg <span dir="ltr"><<a href="mailto:tom@curoverse.com" target="_blank">tom@curoverse.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Thomas,<br>
<br>
Your application can give the user a link/redirect to a URL like this:<br>
<br>
<a href="https://your-apiserver-host/login?return_to=https://your-application-host/any/desired/path" rel="noreferrer" target="_blank">https://your-apiserver-host/<wbr>login?return_to=https://your-<wbr>application-host/any/desired/<wbr>path</a><br>
<br>
(Of course the "return_to" value should be suitably escaped.)<br>
<br>
After a successful login, the user will be redirected to<br>
<a href="https://your-application-host/any/desired/path?api_token=X" rel="noreferrer" target="_blank">https://your-application-host/<wbr>any/desired/path?api_token=X</a>, where X is<br>
of course the newly issued token, and your application can take it<br>
from there -- typically saving X in a session store and redirecting to<br>
a cleaned URL so the api_token doesn't remain in the browser's<br>
Location bar.<br>
<br>
This is the same procedure Arvados Workbench uses, so it might be<br>
helpful to refer to the Workbench code as examples. Here are some of<br>
the relevant bits.<br>
<br>
<a href="https://github.com/curoverse/arvados/blob/master/apps/workbench/app/controllers/application_controller.rb#L511" rel="noreferrer" target="_blank">https://github.com/curoverse/<wbr>arvados/blob/master/apps/<wbr>workbench/app/controllers/<wbr>application_controller.rb#L511</a><br>
<br>
<a href="https://github.com/curoverse/arvados/blob/master/apps/workbench/app/models/arvados_api_client.rb#L232-L244" rel="noreferrer" target="_blank">https://github.com/curoverse/<wbr>arvados/blob/master/apps/<wbr>workbench/app/models/arvados_<wbr>api_client.rb#L232-L244</a><br>
<br>
<a href="https://github.com/curoverse/arvados/blob/master/apps/workbench/app/controllers/application_controller.rb#L586-L597" rel="noreferrer" target="_blank">https://github.com/curoverse/<wbr>arvados/blob/master/apps/<wbr>workbench/app/controllers/<wbr>application_controller.rb#<wbr>L586-L597</a><br>
<br>
--<br>
Tom Clegg<br>
Chief Architect<br>
Curoverse<br>
<div><div class="h5"><br>
<br>
On Tue, Jul 18, 2017 at 3:52 AM, Albrecht, Tom <<a href="mailto:tom.albrecht@roche.com">tom.albrecht@roche.com</a>> wrote:<br>
> Hi,<br>
><br>
> I hope you point me in a direction to achieve an elegant authentication for<br>
> my Arvados API application.<br>
><br>
> I am developing a plugin for a third-party software to download data from<br>
> our Arvados server. The software dictates the language and platform: C# /<br>
> .net and Windows. I managed to access the data using .net's<br>
> System.Net.HttpWebRequest class. What remains to be done is implementing an<br>
> elegant authentication.<br>
><br>
> As a workaround, I logged into the Arvados Workbench using my browser and<br>
> copy-pasted the authentication token into my application. This works but is<br>
> not as user-friendly as I would like it to be. So my question is how to<br>
> achieve the authentication more elegantly without a web browser, for<br>
> instance by passing username and password to the API up front or using some<br>
> kind of single sign-on functionality available in .net.<br>
><br>
> Do you have any suggestions?<br>
><br>
> Best regards<br>
><br>
> Thomas<br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> arvados-dev mailing list<br>
> <a href="mailto:arvados-dev@arvados.org">arvados-dev@arvados.org</a><br>
> <a href="http://lists.arvados.org/mailman/listinfo/arvados-dev" rel="noreferrer" target="_blank">http://lists.arvados.org/<wbr>mailman/listinfo/arvados-dev</a><br>
><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;vertical-align:baseline"><span style="color:black;font-family:arial,helvetica,sans-serif"><b><font size="2">Thomas Albrecht, PhD</font></b></span></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;vertical-align:baseline"><font color="#000000" face="arial, helvetica, sans-serif" size="2">Senior Scientist</font></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;vertical-align:baseline"><font size="2"><span style="color:black;font-family:arial,helvetica,sans-serif">SIAD Solution Delivery & Architecture, pRED Informatics</span><br></font></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"><font face="arial, helvetica, sans-serif" size="2"><span style="color:black">Roche </span><span style="color:black">Pharma</span><span style="color:black"> Research and Early Development</span></font></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"><span style="color:black"><font face="arial, helvetica, sans-serif" size="2"><br></font></span></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"><font face="arial, helvetica, sans-serif" size="2"><span style="color:black">Roche Innovation Center Basel</span><span style="color:black"><br></span></font></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"><span style="color:black"><font face="arial, helvetica, sans-serif" size="2"><br></font></span></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"><font face="arial, helvetica, sans-serif" size="2"><span style="color:black">F. Hoffmann-La Roche Ltd<br></span><span style="color:black">Grenzacherstrasse</span><span style="color:black"> 124<br>4070 Basel</span></font></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"><span style="color:black"><font face="arial, helvetica, sans-serif" size="2">Switzerland</font></span></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"><span style="color:black"><font face="arial, helvetica, sans-serif" size="2"><br></font></span></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;vertical-align:baseline"><span style="color:rgb(0,0,0);font-size:12.8px">Building: 92 / 7.01.09</span><br></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;vertical-align:baseline"><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif;font-size:small">Phone: +41 61 687 9804</span><br></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"><br></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"></p><p style="color:rgb(80,0,80);font-size:12.8px;margin-top:0pt;margin-bottom:0pt;direction:ltr;vertical-align:baseline"><font face="arial, helvetica, sans-serif" size="1"><i><span style="color:black;font-weight:bold">Confidentiality Note: </span><span style="color:black">This message is intended only for the use of the named recipient(s) and may contain confidential and/or proprietary information. If you are not the intended recipient, please contact the sender and delete this message. Any unauthorized use of the information contained in this message is prohibited.</span></i></font></p></div></div>
</div>