Azure active directory “管理”;“认证”;选项卡,用于在AAD B2C应用程序中注册,使用MS Graph
我已经在Azure AD B2C中注册了应用程序。现在我想使用MS Graph SDK在身份验证选项中分配/更改平台配置。如何做到这一点?我以添加带有重定向uri的Web平台为例 应用程序注册中有一个名为Azure active directory “管理”;“认证”;选项卡,用于在AAD B2C应用程序中注册,使用MS Graph,azure-active-directory,microsoft-graph-api,azure-ad-b2c,Azure Active Directory,Microsoft Graph Api,Azure Ad B2c,我已经在Azure AD B2C中注册了应用程序。现在我想使用MS Graph SDK在身份验证选项中分配/更改平台配置。如何做到这一点?我以添加带有重定向uri的Web平台为例 应用程序注册中有一个名为web的属性 我们可以更新应用程序注册以添加重定向uri(https://localhost)插入此属性 Http示例: PATCH https://graph.microsoft.com/v1.0/applications/{application object id} { &quo
web
的属性
我们可以更新应用程序注册以添加重定向uri(https://localhost
)插入此属性
Http示例:
PATCH https://graph.microsoft.com/v1.0/applications/{application object id}
{
"web": {
"homePageUrl": null,
"logoutUrl": null,
"redirectUris": [
"https://localhost"
],
"implicitGrantSettings": {
"enableAccessTokenIssuance": false,
"enableIdTokenIssuance": false
}
}
}
相应的C#示例:
GraphServiceClient-graphClient=新的GraphServiceClient(authProvider);
var应用程序=新应用程序
{
Web=新的Web应用程序
{
HomePageUrl=null,
LogoutUrl=null,
重定向URI=新列表()
{
"https://localhost"
},
ImplicitGrantSettings=新的ImplicitGrantSettings
{
enableAccessTokenIssuation=false,
enableIDTokenIssuation=false
}
}
};
等待graphClient.Applications[“{application object id}”]
.Request()
.UpdateAsync(应用程序);
如果您想添加移动和桌面应用程序平台,您可以查看单页应用程序平台的
publicClient
属性和spa
属性。您知道它是否有文档记录以及记录在哪里吗?我找不到它,但我还需要处理移动、水疗和桌面平台。也许这个例子有点简单。您可以先调用端点,然后使用代码片段功能查看C代码。
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var application = new Application
{
Web = new WebApplication
{
HomePageUrl = null,
LogoutUrl = null,
RedirectUris = new List<String>()
{
"https://localhost"
},
ImplicitGrantSettings = new ImplicitGrantSettings
{
EnableAccessTokenIssuance = false,
EnableIdTokenIssuance = false
}
}
};
await graphClient.Applications["{application object id}"]
.Request()
.UpdateAsync(application);