从Android应用程序对Azure AD进行Firebase身份验证 [英] Firebase authentication to Azure AD from Android app

查看:125
本文介绍了从Android应用程序对Azure AD进行Firebase身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将"Microsoft"登录方法添加到我的Firebase项目中,希望允许用户使用其Azure AD凭据登录到我的Android应用.我已经为使用电子邮件/密码"提供程序进行了所有设置,该程序运行良好.

I am trying to add the "Microsoft" sign in method to my Firebase project, with the hope of allowing users to login to my Android app using their Azure AD credentials. I already have everything set up to use the "Email/Password" provider, which is working well.

我不打算访问任何Azure API,我只需要对给定用户进行身份验证,以便当组织终止该用户帐户时,他不再能够登录我的应用程序.

I don't plan on accessing any Azure APIs, I just need to authenticate a given user so that when an organization terminates said users account, he is no longer able to login to my app.

我正在关注 https://firebase.google.com/docs/auth/android/microsoft-oauth 本指南.我已经在我的Azure AD上注册了一个应用程序,将其设置为允许来自任何组织的帐户以及个人帐户,并将客户端ID和密码添加到我的Firebase项目中.我还已将Firebase项目中的重定向URL添加到Azure上的App注册.

I am following https://firebase.google.com/docs/auth/android/microsoft-oauth this guide. I have registered an app on my Azure AD, set it to allow accounts from any organization as well as personal accounts, and added the client ID and secret to my Firebase project. I have also added the redirect url from the Firebase project to the App registration on Azure.

像示例中一样,我使用startActivityForSignInWithProvider开始登录过程. chrome标签会加载并引导我完成整个身份验证过程. 问题是,它总是返回失败,但Error: (invalid_client) AADSTS700025: Client is public so neither 'client_assertion' nor 'client_secret' should be presented'

I start the login process using startActivityForSignInWithProvider like in the example. The chrome tab loads and takes me through the entire authentication process. The problem is this always returns a failure with the exception Error: (invalid_client) AADSTS700025: Client is public so neither 'client_assertion' nor 'client_secret' should be presented'

这令人困惑,因为要在Firebase上启用此登录提供程序,您需要输入客户端ID和客户端密码.

This is confusing, since, in order to enable this sign-in provider on Firebase, you are required to enter the client ID and client secret.

我尝试将应用程序注册设置将应用程序作为公共客户端处理"设置为是"和否".我还尝试了使用空白的作用域集合,并将"openId"添加到作用域中作为暗中的刺.

I've tried with the app registration setting "Treat application as public client" set to Yes and No. I've also tried with a blank scopes collection and adding 'openId' to the scopes as a stab in the dark.

我对这种Microsoft身份验证的东西有些不了解,因此,朝着正确方向的任何轻推都将不胜感激.

I'm a bit out of my depth with this Microsoft Authentication stuff, so any nudge in the right direction would be greatly appreciated.

推荐答案

在Azure中将该应用程序注册为Web应用程序,而不是本机应用程序.因为Firebase提供的URL是针对Web App的.希望这可以帮助.

Register the app in Azure as web app instead of Native App. Because the URL provided by Firebase is for Web App. Hope this helps.

这篇关于从Android应用程序对Azure AD进行Firebase身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆