Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
How to authenticate without browser/app in c# ?
I did all the operation on dropbox but at the start(only one time) it ask me for the username & password
But I don't want any popup for authentication.I need to do it through code.
Here is my sample code where popup out for username & password then I get the token:
private void GetAccessToken()
{
var login = new DropboxLogin(apiKey,appSecret);
login.Owner = this;
login.ShowDialog();
if (login.IsSuccessfully)
{
Properties.Settings.Default.AccessToken = login.AccessToken.Value;
Properties.Settings.Default.Save();
}
else
{
MessageBox.Show("Failed to get access token................");
}
}
Can you pleas help me?
Thanks in advance!
You cant do it through code, the entire point of it is so you do not handle user credentials in your code, you pass it off to the Dropbox OAuth system and get a token back in return.
Can you please give me an idea to it. or any link which will help me to do it ?
No, because you cannot do it - you must show the dialog as the SDK says - the code you have in your original post is the correct way to do it.
Richard's correct, Dropbox API apps should not handle the user's credentials, but should use the OAuth flow instead. Note that this only needs to be done once per user. Once your app has an access token for a user, it can store and re-use the access token for future API calls for that user without further manual user intervention. Access tokens don't expire by themselves (though they can be manually revoked).
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!