Currenty, in our web app, a Microsoft login with Firebase is implemented. Now, I want to do the same from a React Native app. So far, I found that react-native Firebase library does not directly support this provider. Also, firebase.auth.OAuthProvider('microsoft.com') is not supported in native.
Then, In my next attempt, I implemented Azure login with react-native-azure-ad-2 package, which returns an accessToken and user's data. Now I've been trying to use this token to signIn with Firebase with no success.
onMicrosoftLoginSuccess(accessToken){
const credential = auth.OAuthProvider.credential(accessToken);
auth().signInWithCredential(credential)
.then(response =>{
console.log('Respuesta firebase', response);
})
.catch(e =>{
console.log('Error Firebase', e);
})
}
With this, I get the following error:
Error Firebase [Error: [auth/invalid-credential] The supplied auth credential is malformed or has expired.]
any help is really appreciated!