Skip to content

adding Dropbox OAuth #61

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jdmcnair
Copy link

@jdmcnair jdmcnair commented Jan 12, 2018

Added Dropbbox OAuth functionality. This implied a need to allow individual AuthHelpers to opt out of certain parameters to the provider, because Dropbox rejects the response_mode and nonce parameters on the Auth endpoint, and rejects the response_mode, nonce, and state parameters on the token endpoint. Added functionality to that effect in tns-oauth.ts.

See the note on tns-oauth.ts about an additional bug I fixed for the Dropbox auth helper that may possibly be useful for other auth providers.

@@ -135,6 +159,9 @@ export function loginViaAuthorizationCodeFlow(credentials: TnsOAuthModule.ITnsOA
let errSubCode = qsObj['error_subcode'];
if (codeStr) {
try {
if(credentials.skipNextTokenNav && tokenNavStarted) return true;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a second call to checkCodeIntercept that was happening within the shouldOverrideUrlLoading method of the webview helper. Dropbox was returning an error because the code had already been used to receive a token by that point. I don't know if that would be an issue for other OAuth providers as well, but I've corrected it here using the skipNextTokenNav property, which currently only the Dropbox provider uses.

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

Successfully merging this pull request may close these issues.

1 participant