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

Refine login API to get rid of cookies and automatic guests #109

Open
ryanrdoherty opened this issue Nov 25, 2024 · 0 comments · May be fixed by #108
Open

Refine login API to get rid of cookies and automatic guests #109

ryanrdoherty opened this issue Nov 25, 2024 · 0 comments · May be fixed by #108
Assignees

Comments

@ryanrdoherty
Copy link
Member

ryanrdoherty commented Nov 25, 2024

Worked out the following plan with Dave:

Backend Phase 1 (backward compatible):

  • Add new explicit /create-guest endpoint which returns JSON; checkloginfilter will skip this path
  • /login will conditionally return redirect response OR JSON if Accept header has json

Client worK:

  • On new page load, look for bearer token on local storage; if not present, call /create-guest and save token
  • New client route: /app/complete-login?auth-code=123&others
    • Will be specified in /oauth/authorize?redirectUri=/app/complete-login&state=blah
    • Will call /login with oauth query parameters, JSON Accept header, and existing guest token in Authorize header, then save token and redirect to URL
  • Any service returning 401 when token sent = remove local storage token and reload the page

Backend Phase 2 (breaking changes):

  • Checkloginfilter no longer returns guests; always 401s like services
  • Add more routes or new mechanism to let services declare whether they need a user (will let client call e.g. /, /ontology, /record-types before /create-guest returns
@ryanrdoherty ryanrdoherty linked a pull request Nov 25, 2024 that will close this issue
@ryanrdoherty ryanrdoherty linked a pull request Nov 25, 2024 that will close this issue
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 a pull request may close this issue.

2 participants