Flask - The redirect_uri does not match the registered value LinkedIn sign up with flask-Dance

242 Views Asked by At

I tried finding the Answer but i didn't found the clear answer anywhere.any one can please help me sloving this error.

from flask_dance.contrib.linkedin import make_linkedin_blueprint, linkedin
app = Flask(__name__)
app.secret_key = 'This is a secret key'
app.config["CLIENT_ID"] ='78ycqq8b2ta0iw'
app.config["CLIENT_SECRET"] = 'xeZieOYsfr57Aq1e'

This is my authoirized redirect uri in linked in developers portal https://127.0.0.1:5000/login/linkedin/authorize

This is Login route.

@app.route("/")
def index():
    if not linkedin.authorized:
        print('####################################################')
        return redirect(url_for("linkedin.login"))
    resp = linkedin.get("me")
    print('#############################')
    assert resp.ok
    data = resp.json()
    name = "{first} {last}".format(
        first=preferred_locale_value(data["firstName"]),
        last=preferred_locale_value(data["lastName"]),
    )
    return "You are {name} on LinkedIn".format(name=name)

if __name__ == '__main__':
    app.run(debug=True)

This is the error.

[This is th e error page that is loding][1]

https://i.stack.imgur.com/Mu7Sn.png

0

There are 0 best solutions below