Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
giovaniluigi
6 years agoExplorer | Level 3
Exchange (manually) the authorization code for a re-usable access token fails sometimes
I have integrated the Dropbox API into my .NET software.
In order for the user to link his account with the dropbox folder used by my software, my software gives the user a URL that he enters ...
giovaniluigi
6 years agoExplorer | Level 3
Ok so the only information I have is that when it fails, I get this message from your API:
Type = Dropbox.Api.OAuth2Exception
Message = invalid_grant
Source = Microsoft.Threading.Tasks
ErrorDescription = code has expired (within the last hour)
What I noticed was that the client had a wrong time in its clock.
After synchronizing with the internet time, it worked.
So I am assuming that your API uses the client time for the authentication, which if its true, its a very odd decision.
Could you clarify whether this is the case, or it was just a coincidence that it worked?
Greg-DB
Dropbox Community Moderator
6 years agoI don't believe the Dropbox API OAuth 2 authorization code exchange uses the client's time. In fact, the client isn't supposed to send its client time in the /oauth2/token HTTP request anyway.
The authorization code itself does expire though, after a few minutes (based on the Dropbox server time when the code was issued versus when it is sent back for exchange). It sounds like you just happened to use it after the expiration the first time.
About Discuss Dropbox Developer & API
Make connections with other developers
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!