jupyterhub / gh-scoped-creds

Provide fine-grained push access to GitHub from a JupyterHub
BSD 3-Clause "New" or "Revised" License
25 stars 7 forks source link

CRITICAL: additional requirements added for GitHub App it seems #9

Closed consideRatio closed 2 years ago

consideRatio commented 2 years ago
Traceback (most recent call last):
  File "/home/erik/miniforge3/bin/github-app-user-auth", line 33, in <module>
    sys.exit(load_entry_point('github-app-user-auth', 'console_scripts', 'github-app-user-auth')())
  File "/home/erik/dev/contrib/yuvipanda/github-app-user-auth/github_app_user_auth/auth.py", line 75, in main
    access_token, expires_in = do_authenticate_device_flow(args.client_id)
  File "/home/erik/dev/contrib/yuvipanda/github-app-user-auth/github_app_user_auth/auth.py", line 27, in do_authenticate_device_flow
    f'Go to {verification_resp["verification_uri"]} and enter the code: {verification_resp["user_code"]}'
KeyError: 'verification_uri'

https://github.com/yuvipanda/github-app-user-auth/blob/f480c0fd708e5b6be7f8d456ad660c8b32e3a33e/github_app_user_auth/auth.py#L18-L26

The error stems from the response now is:

{
    'error': 'device_flow_disabled',
    'error_description': 'Device Flow must be explicitly enabled for this App',
    'error_uri': 'https: //docs.github.com'
}

The resolution is to enable a checkbox for the registered GitHub app under general settings.

image

For me, that meant going to https://github.com/settings/apps/hub-jupytearth-org-github-integ. I've verified this started working again after allowing Device flow again.