【发布时间】:2021-11-07 07:20:21
【问题描述】:
我尝试通过 angularfire2 在 Firebase 中使用 Microsoft 实现登录。 Google 登录非常顺利:
return new Promise<any>((resolve, reject) => {
let provider = new firebase.auth.GoogleAuthProvider();
provider.addScope('profile');
provider.addScope('email');
this.afAuth
.signInWithPopup(provider)
.then(res => {
resolve(res);
})
})
现在我正在尝试使用 Microsoft 登录
return new Promise<any>((resolve, reject) => {
let provider = new firebase.auth.OAuthProvider('microsoft.com');
firebase.auth().signInWithPopup(provider)
.then((result) => {
console.log("Result: " + JSON.stringify(result))
resolve(result);
})
.catch((error) => {
// Handle error.
});
})
但它只是传递一个错误:
POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyAssertion?key=AIzaS.... 400
我通过本教程设置了 Microsoft 身份验证: https://medium.com/nerd-for-tech/adding-microsoft-authentication-using-firebase-485f0bd1e3eb
我的函数中是否缺少某些内容或 Microsoft Sing-In 是如何工作的?
【问题讨论】:
标签: angular firebase firebase-authentication angularfire2