ome / omero-gateway-java

Gradle project containing OMERO Java Client Library
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
1 stars 9 forks source link

Login with session ID retrieved from JSON API login #80

Closed dominikl closed 1 year ago

dominikl commented 1 year ago

Apparently the login with a session ID retrieved from JSON API login is not working, see https://forum.image.sc/t/java-gateway-authentication-using-the-json-api/84307 . Unfortunately I've not been able to replicate the issue yet, as I can't login via JSON API in the first place (using our demo server).

Get the token:

GET https://demo.openmicroscopy.org/api/v0/token/ 

Then trying to log in:

POST https://demo.openmicroscopy.org/api/v0/login/
{
"server": 1,
"username": "MY USER",
"password": "MY PASSWORD",
"csrfmiddlewaretoken": "THE TOKEN"
}

Response:

403
{"message": "CSRF Error. You need to include valid CSRF tokens for any POST, PUT, PATCH or DELETE operations. You have to include CSRF token in the POST data or add the token to the HTTP header."}

Stuck there...

imagesc-bot commented 1 year ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/java-gateway-authentication-using-the-json-api/84307/5

dominikl commented 1 year ago

It also looks a bit strange to me that GET .../token/ seems to set a different token in the cookie than it returns, is that expected? Screenshot 2023-08-04 at 09 21 26

dominikl commented 1 year ago

Moved to omero-blitz: https://github.com/ome/omero-blitz/issues/147