I have a bit of a problem, I have a django application that is using Django OAuth Toolkit and I can't get the access token from the server when using Authorization Code flow. Implicit flow works fine. I haven't find anything regarding my problem on stack so I'm really sorry if this is a duplicate of another question.
I can authorize with this url and get the request come back, if i understand it correctly the request token is past in the code param.
http://mydomain.se/o/authorize?scope=read+write&state=kalle&redirect_uri=mycallbakurls&response_type=code&client_id=myclientid
when i then try to do a post to http://mydomain.se/o/token/ with:
grant_type = authorization_code
code = code from authorize call
client_id = my clientId
client_secret = my client secret
redirect_uri = my callback url
i get "error" : "invalid_grant"
back.
Can someone please point me in the right direction what the problem can be?
Best regards Markus
This can happen if the code is expired. They expire pretty quickly by default. You can look up your code in the Django admin under Grants
and change the expiration date to far in the future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With