We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
SneYellow46
4 years agoExplorer | Level 4
Getting refreshed access token from Generated access tokem
Hi,
I have an iOS objective c application connected with dropbox SDK.
We are using generated access token to access apps folder from my BD account.
client = [[DBUserClient allo...
SneYellow46
4 years agoExplorer | Level 4
No I understand the flow of the DB SDK or any Auth provider in that case.
But yeah, we wanted our application to be distributed to few users directly with embedded access token so that that they just install the app and start accessing data/files from our DB account within the application.
Thanks for the information.
Здравко
4 years agoLegendary | Level 20
SneYellow46 wrote:..., we wanted our application to be distributed to few users directly with embedded access token so that that they just install the app and start accessing data/files from our DB account within the application.
...
In such a case you can count it as something like server side application (server side application - not literal - on phone). It's your responsibility to restrict the access to your account! Take in mind that, in such case, everybody accessing/installing your application will have access to your account. Is it acceptable? 🤔...
Good luck.
- SneYellow464 years agoExplorer | Level 4
Yes this is for few of our client. We will provide them tokens manually and they have to enter it to get access. So in such case is it possible to refresh the token from the mobile side without oAuth flow?.
- Здравко4 years agoLegendary | Level 20
SneYellow46 wrote:... So in such case is it possible to refresh the token from the mobile side without oAuth flow?.
Yes, it is. Once refresh token is available the refresh can be done on any platform; not only on mobile (as a process it's the same; just a call to Dropbox server whenever needed without any user interaction). 😉
- SneYellow464 years agoExplorer | Level 4
How I will get the refresh token from generated token? Or you are suggesting some other approach?
is there any sample available for objective-c dropbox SDK?
I know that using oAuth flow tokens are refreshed automatically by DB SDK. But in my case what is the solution?
Thanks,
- Здравко4 years agoLegendary | Level 20
SneYellow46 wrote:...
I know that using oAuth flow tokens are refreshed automatically by DB SDK. But in my case what is the solution?
...
The same. 😉 Once you get to the authentication info just save it and embedding. That's it. Take a look on the description if you have something forgotten.
- SneYellow464 years agoExplorer | Level 4
Hi Здравко ,
Is there a way I can make Generated token with "No expiration"?
Like how it was earlier.
- SneYellow464 years agoExplorer | Level 4
Hi Здравко ,
i get refreshed token using this , and i believe refresh tokens doest expire.
How I can make the DBUserClient, initWithAccessToken call with this refresh token to get access to my dropbox.
similar to ,
client = [[DBUserClient alloc] initWithAccessToken:@"I5wqb1d...."];Can you provide any code sample in objective c to do this? I found with methods with initWithAccessToken which takes in refresh token param but didn't understand much of it.
- Здравко4 years agoLegendary | Level 20
SneYellow46 wrote:...
How I can make the DBUserClient, initWithAccessToken call with this refresh token to get access to my dropbox.
similar to ,
client = [[DBUserClient alloc] initWithAccessToken:@"I5wqb1d...."];
... I found with methods with initWithAccessToken which takes in refresh token ...
No unfortunately, the method 'initWithAccessToken' (any of them) doesn't provide so simple way (don't ask me why; if I have to bet, it's cause Obj-C supposes to be used for client side apps - i.e. with OAuth flow). The method mentioned doesn't receive refresh token directly as a string, but does accept token provider object which on its own can be initialized with 'DBAccessToken' object (don't ask me why this class names so). The last object can represent variety authentication info (non restricted to simple access token).
So first you can create 'DBAccessToken' object using appropriate constructor. Next a client object initialization can be done as performed here. Warning: Select proper transport config, matching to the way that you have used for the refresh token (it's good idea to get a refresh token using PKCE instead)! Mistake for the methods in use will make refresh fails.
Good luck.
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!