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

589 token url #637

Merged
merged 2 commits into from
Nov 8, 2022
Merged

589 token url #637

merged 2 commits into from
Nov 8, 2022

Conversation

ewan-escience
Copy link
Collaborator

@ewan-escience ewan-escience commented Nov 7, 2022

Remove token endpoints from config

Changes proposed in this pull request:

  • Remove the *_TOKEN_URL env variables and adapt the auth module so that the token URL is queried from the well known URL on every request
  • Give the reason when you login with e.g. GitHub through Helmholtz AAI and HELMHOLTZAAI_ALLOW_EXTERNAL_USERS=false

How to test:

  • Remove *_TOKEN_URL values from your .env (see env.example)
  • docker-compose build auth && docker-compose up
  • Set HELMHOLTZAAI_ALLOW_EXTERNAL_USERS=true
  • Login with all three providers, this should work
  • Set HELMHOLTZAAI_ALLOW_EXTERNAL_USERS=false
  • Login with Helmholtz AAI through GitHub or ORCID, you should see in red text You are not allowed to login

Discussion point

Maybe we should cache the token URL instead of querying it on every login. On my tests, ORCID was slow, taking 200 -- 900 ms. Helmholtz and SURF were below 100 ms.

Closes #589

PR Checklist:

  • Increase version numbers in docker-compose.yml
  • Link to a GitHub issue
  • Update documentation
  • Tests

Copy link
Contributor

@dmijatovic dmijatovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Copy link
Contributor

@cmeessen cmeessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm, the new error messages are really helpful 👍

@ewan-escience ewan-escience merged commit 317166b into main Nov 8, 2022
@dmijatovic dmijatovic deleted the 589-token-url branch November 16, 2022 13:50
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.

Remove *_TOKEN_URL from .env
3 participants