我在我的 iOS 应用程序中将 Firebase 与 Microsoft Auth 集成时遇到问题。
登录页面已启动,我可以使用 Office365 帐户登录,但由于以下错误无法完成登录验证:
"AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application:[app-id]"
我确实检查了 Firebase 中的设置,下面是我在 Azure Active Directory 应用程序中添加的设置:
- Web 重定向 URL:“*.firebaseapp.com/__/auth/handler”
- 支持的帐户类型:“任何组织目录中的帐户(任何 Azure AD 目录 Multi-Tenancy )”
这是我实现的 swift 代码:
provider = OAuthProvider(providerID: "microsoft.com")
provider?.customParameters = ["prompt": "consent",
"login_hint": "Login Hint"]
provider?.scopes = ["mail.read", "calendars.read"]
provider?.getCredentialWith(_: nil){ (credential, error) in
if let credential = credential {
Auth.auth().signIn(with: credential) { (authResult, error) in
if let error = error {
print(error.localizedDescription)
}
}
}
}
有谁知道如何解决这个问题或者有同样的问题吗?
最佳答案
When registering apps with these providers, be sure to register the *.firebaseapp.com domain for your project as the redirect domain for your app.
您是否已将 * 替换为您的项目名称?您可以在 firebase 控制台的 Authorized Domains 下找到您的授权域。重定向 uri 应该类似于
https://yourFirebaseApp.firebaseapp.com/__/auth/handler
关于ios - Swift - Firebase Auth with Microsoft Graph(重定向 URL 问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57816895/