jupyterhub / oauthenticator

OAuth + JupyterHub Authenticator = OAuthenticator
https://oauthenticator.readthedocs.io
BSD 3-Clause "New" or "Revised" License
414 stars 365 forks source link

[GitHub] Config option `allowed_organizations` not recognized by `GitHubOAuthenticator` #463

Closed ivan-k-turing closed 3 years ago

ivan-k-turing commented 3 years ago

Bug description

Not sure if that's a bug or if I'm doing something wrong. I'm using GitHubOAuthenticator in tljh, and I cannot restrict access to my organization.

Here is the relevant part of my tljh-config:

auth:
  GitHubOAuthenticator:
    client_id: somestring
    client_secret: another string
    oauth_callback_url: myorgcallbackurl
    scope:
    - read:org
    - read:user
    allowed_organizations:
    - my_org
  type: oauthenticator.github.GitHubOAuthenticator

When I do sudo tljh-config reload, I get

Config option `allowed_organizations` not recognized by `GitHubOAuthenticator`.
Not using allowed_users. Any authenticated user will be allowed.

And it gives access to any GitHub user.

Here is more info from logs after reloading the config:

Running JupyterHub version 1.4.0
Using Authenticator: oauthenticator.github.GitHubOAuthenticator-0.10.0
Using Spawner: traitlets.traitlets.UserCreatingSpawner-5.1.0
Using Proxy: jupyterhub_traefik_proxy.toml.TraefikTomlProxy-0+unknown
Loading cookie_secret from /opt/tljh/state/jupyterhub_cookie_secret
Config option `allowed_organizations` not recognized by `GitHubOAuthenticator`.
Not using allowed_users. Any authenticated user will be allowed.
one-server still running
another-server still running
Initialized 2 spawners in 0.038 seconds
Not starting proxy
Hub API listening on http://127.0.0.1:15001/hub/
Starting managed service cull-idle
Starting service 'cull-idle': ['/opt/tljh/hub/bin/python3', '-m', 'jupyterhub_idle_culler', '--timeout=600', '--c>
Spawning /opt/tljh/hub/bin/python3 -m jupyterhub_idle_culler --timeout=600 --cull-every=60 --concurrency=5 --max->
Checking routes
JupyterHub is now running at http://:8000
200 GET /hub/api/users (cull-idle@127.0.0.1) 55.67ms
200 GET /hub/api (@127.0.0.1) 0.83ms
...
welcome[bot] commented 3 years ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
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! :wave:
Welcome to the Jupyter community! :tada:

consideRatio commented 3 years ago

It sais you are using oauthenticator version 0.10.0, can you scan the changelog and see when the feature was introduced? I bet you need to bump the version and thats the issue.

ivan-k-turing commented 3 years ago

Thanks, that was the problem.