using openid with flask(Python Framework) getting following error: OpenID authentication error

StackOverflow https://stackoverflow.com/questions/21186802

  •  29-09-2022
  •  | 
  •  

Question

I am using Openid for authentication in Flask framework. Following is my code for login View.

@app.route('/login', methods = ['GET', 'POST'])
@oid.loginhandler
def login():
    if g.user is not None and g.user.is_authenticated():
        return redirect(url_for('index'))
    form = LoginForm()
    if form.validate_on_submit():
        session['remember_me'] = form.remember_me.data
        return oid.try_login(form.openid.data, ask_for = ['nickname', 'email'])
    print "Errors of Openid:"+oid.fetch_error()
    return render_template('login.html', 
        title = 'Sign In',
        form = form,
        providers = app.config['OPENID_PROVIDERS'])

This piece of code redirect me to google.com. When i am redirected back to my site (After providing my credentials ). I receive following error:"OpenID authentication error"

Was it helpful?

Solution

I fixed the time/timezone of the server and error was no longer there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top