Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add session based auth workflow #464

Draft
wants to merge 8 commits into
base: deploy-dev
Choose a base branch
from
Draft

add session based auth workflow #464

wants to merge 8 commits into from

Conversation

pmeier
Copy link
Member

@pmeier pmeier commented Aug 2, 2024

Closes #158, closes #178, and closes #179. This is a massive PR that completely overhauls our auth flow. The old auth flow had multiple problems detailed in #178 (comment).

With this PR we now have a session based auth workflow that is independent of the UI through the following endpoints:

  • GET /login: user defined login page
  • POST /login: login endpoint for form-based auth, e.g. username and password
  • GET /oauth-callback: login endpoint for OAuth based auth
  • GET /logout: logout endpoint to clear the active session

The login endpoints can be configured through the ragna.config.Auth object.

After a successful login we set a session cookie and create an entry for the corresponding user in a key-value-store. With this PR we have support for in-memory and Redis key-value-stores.

Although we don't have a way to display it yet, the auth flow already supports authenticating with an API token, which is generated for each user.

Todo in follow-up PRs:

  • documentation
  • tests
  • automatic handling for refresh tokens when using OAuth
  • generic OAuth object

I'm aware that reviewing this is quite the ask. Happy to schedule some time to walk you through any part of the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant