question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: OAuth on Cordova Android, get auth/redirect-cancelled-by-user.

See original GitHub issue

Same as #267 with some differences :

  • I do not use a custom domain.
  • I use Cordova 8.0.0
  • I use cordova-universal-links-plugin in ^1.2.1
  • The authentication was working in past on both iOS and Android, and now work only on ios. (Got auth/redirect-cancelled-by-user)

I’ve try :

universalLinks.subscribe(null, function(eventData) {
    console.log('universalLink: ' + eventData.url);
});

But nothing happen.

<preference name="AndroidLaunchMode" value="singleTask" /> is present

Here is my connection script:

firebase.auth().signInWithRedirect(provider).then(function() {
    return firebase.auth().getRedirectResult();
}).then(function (result) {
    facebookLogin(result);
    if(_callback) _callback(result);
}).catch(function (error) {
    facebookError(error);
    // Go here an get the error `auth/redirect-cancelled-by-user`
    if(_error) _error(error);
});

I’ve try with both GoogleAuthProvider() and FacebookAuthProvider(), same result.

Thanks in advance for your help.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
diegomesatacommented, Oct 11, 2018

My problem was cordova-universal-links-plugin, in the config.xml file you have to register your universal links: <universal-links> <host name="myapp.page.link" scheme="https" /> <host name="myapp.firebaseapp.com" scheme="https"> <path url="/__/auth/callback" /> </host> </universal-links>

That settings will modify your AndroidManifest.xml file on build.

<activity ....> ............. <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:host="vpsapps-b5799.firebaseapp.com" android:scheme="https" android:path="/__/auth/callback"/> </intent-filter> </activity>

But for some strange reason the AndroidManifest.xml was not updated. So I uninstall and reinstall the plugin, build again and the file was modified correctly.

I’m using this fork @prageethsilva/cordova-universal-links-plugin, because the cordova-universal-links-plugin is not building on phonegap cordova 8.

0reactions
ravihanicommented, Jun 22, 2018

I am running into the same issue as well. Appreciate it, if anyone could post the fix for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: OAuth on Cordova Android, get auth/redirect-cancelled ...
message: the redirect operation has been cancelled by the user before finalizing. Cordova version: 7.1.0. Android version: 6.3.0. OAuth Works ...
Read more >
Cordova Google OAuth 2.0 - error in getting token
I'm using cordova v5.1.1 with android v4.0.2 installed. I've tried your suggestion just now, replacing the whitelist plugin with the legacy one.
Read more >
cordova-plugin-oauth - npm
Cordova plugin for performing OAuth login flows.. Latest version: 4.0.1, last published: 3 months ago. Start using cordova-plugin-oauth in ...
Read more >
Authenticate Using OAuth Providers with Cordova - Firebase
With the Firebase JS SDK, you can let your Firebase users authenticate using any supported OAuth provider in a Cordova environment.
Read more >
This domain is not authorized for OAuth operations for your ...
Edit the list of authorized domains from the Firebase console in cordova app. 8212 views ... Suddenly I'm getting this error with a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found