-
Notifications
You must be signed in to change notification settings - Fork 34
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
Getting "Bad Request" back after authenticating #17
Comments
Are you using https? |
Nope. The site is just a basic calculator that I only want employees to have access to. I don't need any profile information, posting permissions, storing of credentials, etc. Since we're already using Google Apps, it would make life a lot easier on me if they could just authenticate using their accounts and then use the calculator. |
Three years later, I am getting exactly the same error. I've been trying to use this example: https://gist.github.com/ashish01/2a4a0f9b525096633ca2. Any ideas? |
To fix this, enable HTTPS. Google refuses HTTP connections (i don't remember where Google wrote this). Anyway, to switch to HTTPS, just add |
After authenticating against google, I'm getting "Bad Request: The browser (or proxy) sent a request that this server could not understand." messages.
I'm using the default material in the docs with my IDs, Secret, and Redirect for what I have from Google. I'm hosting on Heroku if that matters.
googlelogin = GoogleLogin(app)
@app.route('/oauth2callback')
@googlelogin.oauth2callback
def create_or_update_user(token, userinfo, **params):
user = User.filter_by(google_id=userinfo['id']).first()
if user:
user.name = userinfo['name']
user.avatar = userinfo['picture']
else:
user = User(google_id=userinfo['id'],
name=userinfo['name'],
avatar=userinfo['picture'])
db.session.add(user)
db.session.flush()
login_user(user)
return redirect(url_for('estimator'))
The text was updated successfully, but these errors were encountered: