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

Oauth using github gives page not found #399

Open
blpraveen opened this issue Aug 11, 2022 · 2 comments
Open

Oauth using github gives page not found #399

blpraveen opened this issue Aug 11, 2022 · 2 comments

Comments

@blpraveen
Copy link

Redirects 404 page.

@app.route('/github')
def github_login():
    if not github.authorized:
        return redirect(url_for('github.login'))

    account_info = github.get('/user')

    if account_info.ok:
        account_info_json = account_info.json()

        return '<h1>Your Github name is {}'.format(account_info_json['login'])

    return '<h1>Request failed!</h1>'
@singingwolfboy
Copy link
Owner

https://github.com/singingwolfboy/flask-dance-github seems to be working: it's deployed at https://flask-dance-github.herokuapp.com. Could you be more specific about what your problem is, and how to reproduce it?

@TomGoBravo
Copy link

TomGoBravo commented Oct 1, 2022

I ran into this issue when I migrated my code to running in a docker container. I didn't intend to change anything but the browser ended up getting a 404.
Checking the URL of that 404 I saw https://github.com/login/oauth/authorize?response_type=code&client_id=None&redirect_uri=https.... (note the client_id=None). When I changed my production setup to run in a docker container I forgot to migrate the flask secrets.cfg. There doesn't seem to be any warning that client_id is unset and you get a 404 error.

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

No branches or pull requests

3 participants