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

[Generic] Using OAUTH2_AUTHORIZE_URL results in incorrect authorize URL #528

Open
westernspion opened this issue Jul 21, 2022 · 1 comment
Labels

Comments

@westernspion
Copy link

Bug description

Using OAUTH2_AUTHORIZE_URL seems to improperly construct the authorize URL used in the login process. It seems to prepend the base URL (in my case, localhost:8000/hub/) to the actual authorize URL, resulting in a 404 not found.

When setting directly through Jupyter config file, as
c.GenericOAuthenticator.authorize_url = "https://acme.okta.com/oauth2/<redacted>/v1/authorize?scope=openid email
it works as expected and I am redirected to my Okta OAuth provider as expected.

Expected behaviour

Using OAUTH2_AUTHORIZE_URL should not concatenate the base URL to the authorize endpoint. It should behave the same way as the Jupyterhub c.GenericOAuthenticator.authorize_url parameter

Example

When set with OAUTH2_AUTHORIZE_URL environment variable, after clicking the sign in with my provider link from Jupyterhub I get directed to this URL, which results in a 404 with Jupyterhub since this URL doesn't exist
http://localhost:8000/hub/%22https://acme.okta.com/oauth2/<redacted>/v1/authorize?scop.....
^ Removing the base url manually completes the sign in process

But when I use the parameter through Jupyterhubs config it works as expected
https://acme.okta.com/oauth2/<redacted>/v1/authorize?scop.....

Setup
Python 3.8.13
jupyterhub 2.3.1
jupyterlab 3.4.4
amazonlinux:2 container

@welcome
Copy link

welcome bot commented Jul 21, 2022

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@consideRatio consideRatio changed the title Using OAUTH2_AUTHORIZE_URL with GenericOAuthenticator results in incorrect authorize URL [Generic] Using OAUTH2_AUTHORIZE_URL results in incorrect authorize URL Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant