Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #735

Open
RadhikaDeepak opened this issue Jul 14, 2021 · 5 comments

Comments

@RadhikaDeepak
Copy link

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.

@greg-db
Copy link
Contributor

greg-db commented Jul 14, 2021

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.

@RadhikaDeepak
Copy link
Author

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?

@greg-db
Copy link
Contributor

greg-db commented Jul 15, 2021

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.

@RadhikaDeepak
Copy link
Author

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

@greg-db
Copy link
Contributor

greg-db commented Jul 16, 2021

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants