按照https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-android 上的说明我使用 KeyTool 生成了开发签名哈希并在 Azure 门户中注册了我的应用程序。
门户生成了 MSAL 配置,然后我将其粘贴到项目中的 res.raw.auth_config.json 中(my-app-client-id 和 my-app 的包名称只是下面示例中的占位符;实际值是由自动生成的天蓝色):
{
"client_id" : "<my-app-client-id>",
"authorization_user_agent" : "DEFAULT",
"redirect_uri" : "msauth://<my-app's package name>/npYKnQBHywGAasZflTy2xmdpEiU%3D",
"authorities" : [
{
"type": "AAD",
"audience": {
"type": "AzureADMultipleOrgs",
"tenant_id": "organizations"
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
然后我将以下内容添加到 AndroidManifest.xml:
<application>
[..]
<!--Intent filter to catch Microsoft's callback after Sign In-->
<activity
android:name="com.microsoft.identity.client.BrowserTabActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
<!--
Add in your scheme/host from registered redirect URI
note that …Run Code Online (Sandbox Code Playgroud) 根据https://docs.microsoft.com/en-us/graph/api/resources/groups-overview?view=graph-rest-1.0上的在线文档,有四个 AAD 组:Office365、安全性、电子邮件-启用的安全性和分发。
我正在使用以下内容列出组:
graphGroupsPages = await graphServiceClient.Groups
.Request()
//.Filter(????) <= if yes, what should it be?
.GetAsync();
Run Code Online (Sandbox Code Playgroud)
我已经看到了如何列出 Office365(统一)组的示例。
如何仅列出安全组?
azure-active-directory azure-ad-graph-api microsoft-graph-sdks microsoft-graph-api
android ×1