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

Client Authentication Failed Error #3

Open
PaulWestenthanner opened this issue May 23, 2020 · 6 comments
Open

Client Authentication Failed Error #3

PaulWestenthanner opened this issue May 23, 2020 · 6 comments

Comments

@PaulWestenthanner
Copy link

When trying to run the example app, I get an Error 302 with the following message:
{"error":"invalid_client","error_description":"Client authentication failed","message":"Client authentication failed"}

I've created my client_id and client_secret and can confirm that they are actually read correctly form the .env file. Any ideas what the problem could be?

@lakinwecker
Copy link
Owner

Huh, strange, it's no longer working for me either. I'll look into it.

@lakinwecker
Copy link
Owner

Ah. I think it's because pipenv shell loads the .env file when you first run it. So if you run pipenv shell before you run the app it will use the old values. I'll see if I can fix it, but the work around is to just make sure your .env is setup properly, and then exit your shell and start it again and run pipenv shell a second time.

@paulharris
Copy link

I got the same issue.
For me, my server is behind a nginx https forwarding proxy, so my URLs require https:// at the front.
however,
your app.py example has this call:
redirect_uri = url_for("authorize", _external=True)
which generates a http url. Its _external=True so its not using the X-Forwarded-Proto header from nginx to generate the url

So, the solution is to change that line to:
redirect_uri = url_for("authorize", _external=True, _scheme='https')

Problem solved!

@lakinwecker
Copy link
Owner

@paulharris any chance you'd be willing to make the scheme configurable via the env and then use it ? I'd happily accept a PR for this.

@paulharris
Copy link

I've love to but I'm too snowed in, and I'm not that experienced with Python so would be better if you did it the right way the first time...
Big Thanks for the library, its working nicely for me now!

@lakinwecker
Copy link
Owner

Ok, no worries. I'll see when I can find time

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