We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
katharina
9 years agoExplorer | Level 3
Re-authenticate using access token
Hi, i get access token in my app using dropbox api. i want to reauthenticate in the same app on other device using these access token. How i can program it in objective c. Kinldy provide me solutions...
katharina
9 years agoExplorer | Level 3
Hi Greg, I am using it in this way. But after all that it shows me that it session is expired and do you want to relink it.
if (![[DBSession sharedSession] isLinked])
{
[[DBSession sharedSession] updateAccessToken:@"" accessTokenSecret:@"" forUserId:@""];
self.restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
self.restClient.delegate = self;
NSLog(@"Reauthenticating");
[self performSelector:@selector(fetchAllDropboxData) withObject:nil afterDelay:0.2];
// [[DBSession sharedSession] linkFromController:self];
{
YourClientsViewController *control = [self.storyboard instantiateViewControllerWithIdentifier:@"YourClientsViewController"];
[self.navigationController pushViewController:control animated:YES];
}
else
{
[[DBSession sharedSession] linkFromController:self];
UIAlertView *view = [[UIAlertView alloc]initWithTitle:@"Account Login!" message:@"Your dropbox account has been login" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[view show];
if (!loadData)
{
loadData = @"";
}
// [MBProgressHUD showHUDAddedTo:self.view animated:YES];
[self performSelector:@selector(fetchAllDropboxData) withObject:nil afterDelay:0.2];
}
Can you please help me to modify this code so that it will work.
Greg-DB
Dropbox Community Moderator
9 years agoI'm not sure I follow. Can you share the full error/output you're getting?
Also, to clarify, you are entering the values in updateAccessToken:@"" accessTokenSecret:@"" forUserId:@"" and are just redacting them for the forum, correct?
You should, as the access token is sensitive, but I want to make sure you do have the right values there. The updateAccessToken parameter should be the OAuth 1 access token key, the accessTokenSecret parameter should be the OAuth 1 access token secret, and the forUserId should be your account's user ID.
Also, to clarify, you are entering the values in updateAccessToken:@"" accessTokenSecret:@"" forUserId:@"" and are just redacting them for the forum, correct?
You should, as the access token is sensitive, but I want to make sure you do have the right values there. The updateAccessToken parameter should be the OAuth 1 access token key, the accessTokenSecret parameter should be the OAuth 1 access token secret, and the forUserId should be your account's user ID.
About Dropbox API Support & Feedback
Find help with the Dropbox API from 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!