<div dir="ltr"><br><div class="gmail_extra">Hi Will,</div><div class="gmail_extra"><br></div><div class="gmail_extra">thanks for the clarification.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Maybe we could add a /api/v0/logout/ then in addition, then login and logout exist in both,</div><div class="gmail_extra">webclient and api.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I tried the java example. Unfortunately it crashes with a parser exception here (invalid json),</div><div class="gmail_extra">but for testing I had to replace the httpclient by an implementation which accepts untrusted</div><div class="gmail_extra">ssl certificates, so maybe the error is on my side. </div><div class="gmail_extra">Anyway, in the example the session is never closed. </div><div class="gmail_extra"><br></div><div class="gmail_extra">Cheers,</div><div class="gmail_extra">Manuel</div><div class="gmail_extra"><br><div class="gmail_quote">:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
Hi Manuel,
<div><br>
</div>
<div> Apologies for the confusion.</div>
<div><br>
</div>
<div>All http calls to OMERO.web will close any statefull services they use, so this will limit the</div>
<div>resources that are consumed on the server during your session. However, it is still a good idea to</div>
<div>log out when you are done, since this will free up the server session and prevent large stale session cleanups every 30 minutes.</div>
<div><br>
</div>
<div>It is fine to combine /api/ and /webgateay/ or /webclient/ URLs in the same session.</div>
<div>There’s no technical difference between them. It’s just that the /api/ URLs are</div>
<div>designed to be more consistent and are better documented.</div>
<div><br>
</div>
<div> Regards,</div>
<div><br>
</div>
<div>   Will.</div>
<div><br>
</div>
<div><br>
</div>
<div>PS: did you also see the JSONClient.java example linked under <a href="https://docs.openmicroscopy.org/omero/5.4.6/developers/json-api.html#getting-started" target="_blank">https://docs.<wbr>openmicroscopy.org/omero/5.4.<wbr>6/developers/json-api.html#<wbr>getting-started</a> ?</div>
<div>Is that any use to you?</div>
<div><br>
</div>
<div><br>
<div>
<blockquote type="cite">
<div>On 7 Aug 2018, at 07:33, Manuel Stritt <<a href="mailto:manuel.stritt@idorsia.com" target="_blank">manuel.stritt@idorsia.com</a>> wrote:</div>
<br class="m_-7698251738287522650Apple-interchange-newline">
<div>
<div dir="ltr">Hi Damir,
<div><br>
</div>
<div>thanks a lot for that.</div>
<div><br>
</div>
<div>Here you do the logout via the URL /webclient/logout/</div>
<div>And for the login you are using /webclient/login/</div>
<div><br>
</div>
<div>According to the documentation</div>
<div><a href="https://docs.openmicroscopy.org/omero/5.4.7/developers/json-api.html#getting-started" target="_blank">https://docs.openmicroscopy.<wbr>org/omero/5.4.7/developers/<wbr>json-api.html#getting-started</a><br>
</div>
<div>I'm using the URL</div>
<div>/api/v0/login/</div>
<div>for login instead. </div>
<div>So should we use the /webclient/ methods or the /api/v0/ methods?</div>
<div><br>
</div>
<div>Unfortunately there's no /api/v0/logout/ available, this only works via /webclint/logout/.</div>
<div><br>
</div>
<div>Or can these two be combined, e.g. login with /api/v0/login/ and logout via /webclient/logout/ ?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Manuel</div>
<div><br>
</div>
<div><br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Aug 6, 2018 at 10:06 PM, Damir Sudar <span dir="ltr">
<<a href="mailto:dsudar@lbl.gov" target="_blank">dsudar@lbl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto">Hi Manuel,
<div><br>
</div>
<div>Roger Noble from Zegami put together a small python program to connect to an OMERO server via the webgateway and retrieve data and visualizations. Originally that was developed for public repositories such as IDR, but I submitted some code to
 enable it to work with non public servers with full authentication which is now integrated into that package. I used the python requests package to handle opening and closing the session. See: <br>
<a href="https://github.com/zegami/omero-idr-fetch" target="_blank">https://github.com/zegami/omer<wbr>o-idr-fetch</a></div>
<div><br>
</div>
<div>Cheers,</div>
<div>Damir</div>
<div><br>
<div id="m_-7698251738287522650m_945901052266033364AppleMailSignature">Sent from my iPad, please excuse poor spelling</div>
<div><br>
On Aug 6, 2018, at 08:20, Manuel Stritt <<a href="mailto:manuel.stritt@idorsia.com" target="_blank">manuel.stritt@idorsia.com</a>> wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="ltr">
<div>Dear all,<br>
</div>
<div><br>
</div>
<div>one more question regarding the webgateway. Currently I </div>
<div>- get a crsf-token</div>
<div>- login using the crsf-token and get a session-id</div>
<div>- do <a href="http://s.th/" target="_blank">s.th</a>. e.g. query image data</div>
<div><br>
</div>
<div>now - should I not close the session or do a logout at the end?</div>
<div><br>
</div>
<div>I guess it will timeout after a while.  So is it correct to just create new sessions / login calls - or is there a way to close it?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Manuel</div>
<div> <br>
</div>
<br>
<div class="gmail_extra">
<div class="gmail_quote"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="ltr">
<div>Hi Manuel</div>
<div><br>
</div>
<div>You'll always need to create a web Django session. Have you seen <a href="https://docs.openmicroscopy.org/omero/5.4.7/developers/json-api.html#getting-started" target="_blank">
https://docs.openmicroscopy.or<wbr>g/omero/5.4.7/developers/json-<wbr>api.html#getting-started</a> ? It includes an example of using Python to log in to web.</div>
<div><br>
</div>
<div>Simon<br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 3 August 2018 at 15:05, Manuel Stritt <span dir="ltr">
<<a href="mailto:manuel.stritt@idorsia.com" target="_blank">manuel.stritt@idorsia.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Dear all,
<div><br>
</div>
<div>I'm using the webgateway to programmatically e.g. download images. That works if a user used the web viewer before and logged in there,</div>
<div>but it would be nice to use the webgateway completely programmatically without user interaction.</div>
<div><br>
</div>
<div>Is there a way to perform an authentication via rest-API / webgateway directly?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Manuel<br clear="all">
<div><br>
</div>
<br>
</div>
</div>
<br>
<div><br>
</div>
<div>
<div><font size="2">The information of this email and in any file transmitted with it is strictly confidential and may be legally privileged.</font></div>
<div><font size="2">It is intended solely for the addressee. If you are not the intended recipient, any copying, distribution or any other use of this email is prohibited and may be unlawful. In such case, you should please notify the sender
 immediately and destroy this email.</font></div>
<div><font size="2">The content of this email is not legally binding unless confirmed by letter.</font></div>
<div><font size="2">Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of the sender's company.</font></div>
</div>
<br>
______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.openmicroscopy<wbr>.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" rel="noreferrer" target="_blank">http://lists.openmicroscopy.or<wbr>g.uk/mailman/listinfo/ome-deve<wbr>l</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<br>
<span style="font-size:10pt">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</div>
<br>
______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.openmicroscopy<wbr>.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" rel="noreferrer" target="_blank">http://lists.openmicroscopy.or<wbr>g.uk/mailman/listinfo/ome-deve<wbr>l</a><br>
<br>
</blockquote>
</div>
<br>
<br>
</div>
</div>
<br>
<div><br>
</div>
<div>
<div><font size="2">The information of this email and in any file transmitted with it is strictly confidential and may be legally privileged.</font></div>
<div><font size="2">It is intended solely for the addressee. If you are not the intended recipient, any copying, distribution or any other use of this email is prohibited and may be unlawful. In such case, you should please notify the sender
 immediately and destroy this email.</font></div>
<div><font size="2">The content of this email is not legally binding unless confirmed by letter.</font></div>
<div><font size="2">Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of the sender's company.</font></div>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div><span>______________________________<wbr>_________________</span><br>
<span>ome-devel mailing list</span><br>
<span><a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.openmicroscopy<wbr>.org.uk</a></span><br>
<span><a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.or<wbr>g.uk/mailman/listinfo/ome-deve<wbr>l</a></span><br>
</div>
</blockquote>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.openmicroscopy<wbr>.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" rel="noreferrer" target="_blank">http://lists.openmicroscopy.or<wbr>g.uk/mailman/listinfo/ome-deve<wbr>l</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
</div>
</div>
<br>
<div><br>
</div>
<div>
<div><font size="2">The information of this email and in any file transmitted with it is strictly confidential and may be legally privileged.</font></div>
<div><font size="2">It is intended solely for the addressee. If you are not the intended recipient, any copying, distribution or any other use of this email is prohibited and may be unlawful. In such case, you should please notify the sender
 immediately and destroy this email.</font></div>
<div><font size="2">The content of this email is not legally binding unless confirmed by letter.</font></div>
<div><font size="2">Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of the sender's company.</font></div>
</div>
______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.<wbr>openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.<wbr>org.uk/mailman/listinfo/ome-<wbr>devel</a><br>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<span style="font-size:10pt">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</div>

<br>______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.<wbr>openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" rel="noreferrer" target="_blank">http://lists.openmicroscopy.<wbr>org.uk/mailman/listinfo/ome-<wbr>devel</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>
</div></div>

<br>
<div><br></div><div><div><font size="2">The information of this email and in any file transmitted with it is strictly confidential and may be legally privileged.</font></div><div><font size="2">It is intended solely for the addressee. If you are not the intended recipient, any copying, distribution or any other use of this email is prohibited and may be unlawful. In such case, you should please notify the sender immediately and destroy this email.</font></div><div><font size="2">The content of this email is not legally binding unless confirmed by letter.</font></div><div><font size="2">Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of the sender's company.</font></div></div>