I read these docs https://firebase.google.com/docs/auth/web/cordova and followed all the steps described with no error and I'm getting this error when the app redirects back from the Google Login. Im testing this on Android phone.
code: "auth/redirect-cancelled-by-user"
message: "The redirect operation has been cancelled by the user before finalizing."
The code for the signIn is as follows:
login(){
let provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithRedirect(provider);
}
ngOnInit(){
firebase.auth().getRedirectResult().then(function(result) {
if (result.credential) {
// This gives you a Google Access Token.
// You can use it to access the Google API.
var token = result.credential.accessToken;
// The signed-in user info.
var user = result.user;
console.log(user);
// ...
}
}).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
console.log(error);
});
}
ionViewWillLoad(){
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
// User is signed in.
console.log('Observer');
console.log(user);
} else {
// No user is signed in.
}
});
}
I've removed and installed several times the required plugins indicated in the docs and I'm still facing the same error. Anyone who has got Oauth working with Firebase and Cordova please share your knowledge, will be greatly appreciated!
config.xmlfile correctly. Also try to test that the cordova universal link plugin is working as expected by logging the incoming URL. - bojeilcordova universal link pluginatleast inorder to get to this position. if I install the plugin I cannot even build the app. What is the problem ? that universal link plugin ? - Santosh