Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
whats
3 years agoExplorer | Level 4
Xcode swiftydropbox setup
Hey,
Has anyone been able to set up Swiftydropbox without any user prompt ? I dont know the order or what needs to be called. I don't want the user to have to set up any login. Any quick breakdowns on the process for me to use a refresh key and app key in order to get the access token without a user prompt would be amazing
Thank you !
18 Replies
Replies have been turned off for this discussion
- Greg-DB3 years ago
Dropbox Community Moderator
It's not possible to skip the app authorization flow and gain access to the end-user's account. In order for the app to access the user's account, the user needs to grant the app access to their account. This only needs to be done manually once per app-account pair.
- whats3 years agoExplorer | Level 4
I dont want to gain access to their account, I want to use my account refresh token and app key. Is this possible ?
- Greg-DB3 years ago
Dropbox Community Moderator
The API was designed with the intention that each user would link their own Dropbox account, in order to interact with their own files. While it is technically possible to always connect to just one account for all users, we do not officially support this, for various technical and security reasons.
- whats3 years agoExplorer | Level 4
Absolutely understandable, would you be able to direct me on this flow?
- Здравко3 years agoLegendary | Level 20
whats, you can take a look here how you can perform OAuth by hands and use the refresh token in your code (you'll need app secret too by the way).
- whats3 years agoExplorer | Level 4
Hey thank you so much! What does your code look like in xcode once you have these parameters? What are you calling?
- Здравко3 years agoLegendary | Level 20
whats wrote:... What does your code look like in xcode once you have these parameters? What are you calling?
The code anywhere looks exactly like you would code it, nothing else. There is no a single way to do it - it's matter of design decision. If you want to stick as much as possible to the Dropbox Swift SDK, you should use PKCE version of what I posted (i.e. not exactly the same) - Dropbox Swift SDK doesn't support app secret. In such a case (PKCE usage) you need to implement DropboxAccessToken object yourself and pass it further on client object initialization.
To avoid PKCE you need to re-implement (replace) refreshing process (adding app secret there).
Good luck.
- whats3 years agoExplorer | Level 4
Hey Здравко ! I tried building this today and had a few questions if you're know the answers,
-When you say "replace" the refreshing process, what do you mean exactly?
-Where would I use the app secret? Would this only be in the beta 10.0.1?
-Do I use the DropboxTransportClient?
-Is the initial call, dropbox = DropboxClient(key,secret,refreshtoken)? Then use dropbox to call api?
Thank you for all the help ! - Здравко3 years agoLegendary | Level 20
whats wrote:...
-When you say "replace" the refreshing process, what do you mean exactly?
...😁 Yeah... Maybe I said it too.. "hard". That's why I clarified: "adding app secret". "replace" here means edit the algorithm, no so much actual replace. This results from, as I already said, application secret is NOT supported in Dropbox Swift SDK (don't ask me why). It's supported by API itself (as you probably already know) and most of the other Dropbox SDKs.
whats wrote:...
-Where would I use the app secret? Would this only be in the beta 10.0.1?
...No, it's not related to any particular version, but rather all of them (or that what you're using).
whats wrote:...
-Do I use the DropboxTransportClient?
...Hm..🤔 To be honest, I'm not sure what you mean here. You will always use that class, but you don't need to do it explicitly. It's just a internal class. If needed, clarify what you mean.
whats wrote:...
-Is the initial call, dropbox = DropboxClient(key,secret,refreshtoken)? Then use dropbox to call api?...
🙂 As far as I know there is no such an init call (might be convenient for many users, but...). The refresh token itself is part of the DropboxAccessToken that you need to pass (you don't need to handle/pass it in addition). App key is part of the app configuration (doesn't need to pass the refresh token in addition). You can add app secret to the configuration in the same way as done already for the app key and use it further in the updated refreshing (again in the same way as app key is used there - the only change needed there).
- whats3 years agoExplorer | Level 4
Thank you again for the detailed reply! I guess I am lost to which part needs the app secret, I was unable to locate where I could pass it
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!