Reputation: 6814
I'm using the Dropbox.API Nuget (latest version 6.26.0) for my C#.net desktop application. I'm obtaining a DropBox access token by requesting authorization using my client_id:
var requestUrl = $"https://www.dropbox.com/oauth2/authorize?client_id={_appKey}&response_type=code";
I am invoking this without a redirect_url, therefore it presents me a webpage with the access token. This is the access token i am using for other SDK API calls.
The response I get from this includes a URL which allows me to confirm and approve the auth request, which it then presents me with an access token string.
Then i take that access token and use it to initialize the DropboxClient.
var client = new DropboxClient(AccessToken)
Where the AccessToken is indeed the access token string (confirmed).
Now oddly enough, im getting an invalid access token exception when i try to create the DropboxClient instance.
Question: Seems like im missing something thats right under my nose. What am i doing wrong?
Note that there is a thread, https://github.com/dropbox/dropbox-sdk-java/issues/113, but it leads to a deadend.
Also note that I had this working just fine a few days ago. And suddenly now it is not working. I had it working by following this documentation: https://developers.dropbox.com/oauth-guide
.
Upvotes: 0
Views: 1126
Reputation: 6814
I found the answer. I blame it on poor documentation by DropBox. Basically, the "access token" that i've been using is actually the "authorization token", which is what i need to use to obtain the actual access token ( via https://api.dropboxapi.com/oauth2/token ).
Solution that worked for me:
Upvotes: 1