首页 > 解决方案 > 有没有办法在 azure Ad B2C 租户下的身份体验框架中自动创建策略密钥?

问题描述

有没有办法使用 API 或使用 PowerShell 在身份体验框架下创建 Azure AD B2C PolicyKey。

我已经通过手动创建在门户网站中进行了尝试..它按预期运行良好。但现在我正在尝试通过 powershell 创建..令人惊讶的是我没有找到任何方式 restapi 或 powershell Invoke-WebRequest -Uri“ https:/ /main.b2cadmin.ext.azure.com/api/trustframework?tenantId= $TenantID&overwriteIfExists=true" -Method POST -Body $strBody -ContentType "application/xml" -Headers $htHeaders -UseBasicParsing 上面的url用于上传策略。 . 是否有任何类似的方法可以在身份体验框架中创建策略密钥?

标签: azureazure-active-directoryazure-ad-b2c

解决方案


根据我的研究,您可以使用https://main.b2cadmin.ext.azure.com/api/Jwks/PutSecret?tenantId= &storageReferenceId=&keyUsage= 创建策略密钥。

Method : Put
URL : https://main.b2cadmin.ext.azure.com/api/Jwks/PutSecret?tenantId=<your Azure AD B2C tenant id>&storageReferenceId=<your key name>&keyUsage=<you key usage> 
Header
Authorization : Bearer token
Content-type : application/xml

Body

推荐阅读