'Firebase authentication dependency
A year ago we have deployed an app (created with flutter) in the appstore, it has been downloaded and used frequently. The app simply enhanced the views of the website.
So far, we have been using the basic firebase authentication to store the users email and password :
try {
await firebaseAuth.createUserWithEmailAndPassword(
email: email, password: password);
} on FirebaseAuthException catch (signUpError) {
if (signUpError.code == 'email-already-in-use') {
try {
await firebaseAuth.signInWithEmailAndPassword(
email: email, password: password);
return null;
} on FirebaseAuthException catch (loginError) {
if (loginError.code == 'error-wrong-password')
throw PasswordChangedException();
throw LoginException(errorCode: loginError.code);
}
}
With those email and password, we signed the user in on mentionned website and displayed the data. (The problem often occured was, that if the user changes the password on the website, our app would not work anymore, because the pw would not match our firebase auth pw.)
However we are now in contact with the website and would now have access to the API via OIDC authentication.
The question is now how we merge firebase authentication and the authentication of the website via OIDC?
In my view, firebase authentication (email/pw), or just the access of firestore, should be dependent on the authentication via OIDC, that if I change the password (via website), the firebase authentication would still work. How can one implement that behaviour?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
