scalableminds / webknossos

Visualize, share and annotate your large 3D images online
https://webknossos.org
GNU Affero General Public License v3.0
130 stars 24 forks source link

`yarn run startf` fails to bypass any local authentication #8027

Closed aaronkanzer closed 3 months ago

aaronkanzer commented 3 months ago

Context

Cc @fm3 -- similar to https://github.com/scalableminds/webknossos/issues/7773

Rather than running the local ./start_docker.sh script for local testing, I'm doing some UI-based changes, thus I am running yarn run startf to initialize the local environment (e.g. I need hot-reloading for the UI changes)

It seems that I continously get 401 errors from /user endpoint. Furthermore, upon trying to create an organization, I'm also blocked (it seems that something regarding the request.identity param being passed to the backend is failing -- I tried hacking a bit and making things bypass auth by default, but I'd rather not work via a hack.

I've also tried passing the args. for the sample organization into the sbt configuration for the backend launched in proxy.js

I tried cloning the most recent master branch from scalableminds/webknossos and got similar issues.

Any chance you could share how you correctly authenticate a local session? -- much appreciated for any guidance and advice!

Cc @kabilar

Steps to Reproduce the bug

  1. Clone the repo
  2. Run yarn install within node v18
  3. Run yarn run startf
  4. Attempt any type of login/onboarding and see that 401s continuously resolve.

Your Environment for bug

fm3 commented 3 months ago

Hmm, I’m not sure what’s different between yours and our setup. When starting via yarn start (or startf) with an empty database setup, webknossos should automatically insert the sample organization, including a sample user sample@scm.io with password secret as defined in conf/application.conf. When I then visit localhost:9000, I can log in with these credentials. After that, the request.identity should be correctly set for requests sent with the right cookie. I’d recommend clearing your local database contents (e.g. yarn refresh-schema) and trying again. Server logs may also give some hints as to what is happening.

Hope this helps!

aaronkanzer commented 3 months ago

@fm3 -- that seemed to work! 🎉 thank you!