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

Using a nifty new DNS entry, instead of an IP address #542

Closed
arokem opened this issue Jan 30, 2019 · 14 comments
Closed

Using a nifty new DNS entry, instead of an IP address #542

arokem opened this issue Jan 30, 2019 · 14 comments
Labels

Comments

@arokem
Copy link
Contributor

arokem commented Jan 30, 2019

My neuro-themed Pangeo is up and running! This instance is going to be accessible to a relatively small group of researchers that I collaborate with directly. They are all going to be members of a GitHub org, so I would like to use GitHub OAuth for authentication. This seems to work.

Now @jhamman gave me the nifty DNS entry learning2learn.pangeo.io to use, but I can't quite make GitHub authentication work. There are 4 places where the IP address appears: twice in the GitHub app page, once in the jupyter_config.yaml file (under proxy: service: leadBalancerIP) and once in the secret_config.yaml file (under auth: github: callbackUrl).

Which of these do I need to change? Do I need to change anything on the GCP side, related to the IP address?

Thiis might also be a bit tricky to debug because my GitHub user name is under both the GitHub org that I am using for authentication, as well as explicitly entered into an admin block of the authentication block of the secret_config.yaml.

@jhamman
Copy link
Member

jhamman commented Jan 30, 2019

@arokem - Does your secret yaml look something like:

jupyterhub:
  proxy:
    secretToken: <SECRET>

  auth:
    type: github
    github:
      clientId: "<SECRET>"
      clientSecret: <SECRET>
      callbackUrl: "http://learning2learn.pangeo.io/hub/oauth_callback"

@arokem
Copy link
Contributor Author

arokem commented Jan 30, 2019 via email

@jhamman
Copy link
Member

jhamman commented Jan 30, 2019

I think you need to change the callbackUrl to what I have above and make sure you've set the Github Oauth callback to points to the hub.

@arokem
Copy link
Contributor Author

arokem commented Jan 30, 2019 via email

@arokem
Copy link
Contributor Author

arokem commented Jan 30, 2019

screen shot 2019-01-30 at 10 02 39 am

@jhamman
Copy link
Member

jhamman commented Jan 30, 2019

Yes, that's right. Not sure why you are getting the forbidden response.

@arokem
Copy link
Contributor Author

arokem commented Jan 30, 2019 via email

@rsignell-usgs
Copy link
Member

rsignell-usgs commented Jan 30, 2019

In case it's useful, here's the auth snippet from our 'jupyter-config.yaml' pangeo.esipfed.org, where we whitelist access by github organization:

  auth:
    admin:
      access: true
      users:
        - jreadey
        - rsignell-usgs

    type: github
    github:
      clientId: "SECRET"
      clientSecret: "SECRET"
      callbackUrl: "http://pangeo.esipfed.org/hub/oauth_callback"
      org_whitelist:
        - "HDFGroup"
        - "pangeo-data"
        - "ESIPFed"
        - "USGS-CMG"
        - "cdi-workshops"
    scopes:
      - "read:org"

@arokem
Copy link
Contributor Author

arokem commented Jan 30, 2019 via email

@rsignell-usgs
Copy link
Member

Hmm, can't remember. There is some discussion here:
jupyterhub/zero-to-jupyterhub-k8s#687 (comment)

@arokem
Copy link
Contributor Author

arokem commented Jan 30, 2019

The following seems to work: I created a new GitHub app that is now owned by the organization for which I am doing authentication (https://github.com/learning-2-learn) and then set the read:user scope. Setting both scopes did not work by itself, but if the org owns that app, then setting read:user or read:user as well as read:org both work. I still have to try this with other users, but it seems to work whether my GH user is designated an admin or not. I am not sure what to do if you want to authenticate two orgs, but that seems to already be working for others. I guess there is something else going on behind the scenes on the GitHub organization/apps permissions side.

@arokem
Copy link
Contributor Author

arokem commented Jan 30, 2019

One more thing: it seems that members of the org have to change their membership from private (the default) to public. And they have to do that themselves -- you can't do it for them.

@rsignell-usgs
Copy link
Member

@arokem, to avoid putting this requirement on users, in the github settings for the org, you can change the "third party access" setting to "no restrictions", like this:
2019-01-31_7-16-43

@stale
Copy link

stale bot commented Apr 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 1, 2019
@jhamman jhamman closed this as completed Apr 1, 2019
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

3 participants