dropbox-sdk-js icon indicating copy to clipboard operation
dropbox-sdk-js copied to clipboard

need to set force_reauthentication true but not found method to do it through DbxWebAuth.newRequestBuilder() because its not having method to set it as true. Is there any way to do it

Open RadhikaDeepak opened this issue 4 years ago • 5 comments

Why is this feature valuable to you? Does it solve a problem you're having? A clear and concise description of why this feature is valuable. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. (if applicable)

Additional context Add any other context or screenshots about the feature request here.

RadhikaDeepak avatar Jul 14 '21 17:07 RadhikaDeepak

No, unfortunately the 'force_reauthentication' OAuth parameter isn't currently implemented in the Dropbox API v2 Java SDK, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

greg-db avatar Jul 14 '21 17:07 greg-db

I have generated authorization url by using DbxWebAuth.newRequestBuilder() and added force_authentication parameter like below

String authorizeUrl = getDropBoxAuthObject().authorize(DbxWebAuth.newRequestBuilder().build()); authorizeUrl=authorizeUrl+"&force_reauthentication=true";
Its working like the way its expected. its signout the account which is already logged in and shows the sign in screen. small doubt, any hidden problems if I use like this?

RadhikaDeepak avatar Jul 15 '21 13:07 RadhikaDeepak

You can certainly modify the URL with your own code if you wish.

However, I recommend properly parsing the URL string, setting the URL parameter, and then rebuilding the URL string, e.g., using java.net.URL, rather than just appending to the string.

greg-db avatar Jul 15 '21 14:07 greg-db

Thank you for your suggestion. My requirement is, whenever a user is already logged in to the dropbox account in some other tab then need to show an option like "do you want to continue with the logged in account( as "xxx" person) or sign into new account. I have checked force_reapprove option, its just asking the permission to access or not but if I click, "cancel" new sign in page is not showing so is there any other option to fulfill my requirement

RadhikaDeepak avatar Jul 16 '21 07:07 RadhikaDeepak

The force_reauthentication and force_reapprove are the only options for this. Neither specifically prompts the user in the exact way you describe, but the user can switch accounts manually using the drop down menu in the top right of the page. (That is, while signed in and prompted to authorize the app, they can "Sign out", then sign in to a different account to authorize the app there.)

greg-db avatar Jul 16 '21 13:07 greg-db