🐈 Community
» Forums » Freelancers » Athenthicating OAuth2.0 through Python - Miss...
Page options
ayala-iu
Community Member

Athenthicating OAuth2.0 through Python - Missing or invalid redirect_uri parameter value

Hi,

 

I'm trying to get access to the Upwork API, using Python. I'm using the official OAuth2 Python library (link), I've followed the installation procedure and I'm running the file "example/myapp.py" (link) as it's indicated in the instructions. I've changed the "client_id" from "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" for the field "Key" in my API key and "client_secret" from "xxxxxxxxxxxxx" for the field "Secret" in my API key.

The main question that I have is what should it be my "redirect_uri"? In the documentation of the API it says: "Redirect URI, must be equal or similar to the callback specified in the key settings. Required for `authorization_code` grant." (link). I've tried two things:

  • In my API Key I've left empty the "Callback URL", and set the "redirect_uri" to ""
  • In my API Key I've set the "Callback URL" to "https://localhost", and set the "redirect_uri" to "https://localhost"

The program provides me with "authorization_url", but when I insert it in my browser in both cases I get the error message: "Missing or invalid redirect_uri parameter value".

I haven't used much OAuth2.0, so it might be something simple to fix. But given that I only want to get my data in my Python program, I'm not sure what should be my "Callback URI" and "redirect_uri".

 

Thanks for your help!

ACCEPTED SOLUTION
ayala-iu
Community Member

I figured it out, I had a typo in my "redirect_uri". If you want to use the Python APi, as I described it works you only need to set:

I hope it helps.

View solution in original post

2 REPLIES 2
ayala-iu
Community Member

I figured it out, I had a typo in my "redirect_uri". If you want to use the Python APi, as I described it works you only need to set:

I hope it helps.

grendon
Community Member

Glad we could help 😅

Latest Articles
Featured Topics
Learning Paths