【问题标题】:Azure - Access token request with a certificate - postmanAzure - 带有证书的访问令牌请求 - 邮递员
【发布时间】:2021-08-28 03:32:56
【问题描述】:

我想使用证书测试对密钥库的访问 场景 第二种情况:带有证书的访问令牌请求 https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow

我正在努力供应

client_assertion

您需要创建一个断言(JSON Web 令牌),并使用您注册为应用程序凭据的证书进行签名。阅读证书凭证以了解如何注册您的证书以及断言的格式。

我不知道为什么必须使用powershell,而且我没有pfx,所以不能使用 https://blogs.aaddevsup.xyz/2020/10/how-to-use-postman-to-perform-a-client-credentials-grant-flow-with-a-certificate/

是否可以使用邮递员生成签名的 JWT?

注意:添加了 postman 中的证书。让这部分得到照顾

【问题讨论】:

  • 当然可以使用postman来获取token。
  • 肯定会有。请详细说明步骤

标签: azure postman azure-keyvault


【解决方案1】:

我认为你不能直接在postman中生成client_assertion,请使用下面的脚本创建一个自分配证书,然后你可以使用script you mentioned获取令牌。

$certroopath = "C:\Users\Administrator\Desktop"
$certname = "mycert1"
$certpassword = "P@ssw0rd1234"

$cert = New-SelfSignedCertificate -DnsName "$certname" -CertStoreLocation cert:\CurrentUser\My
$pwd = ConvertTo-SecureString -String $certpassword -Force -AsPlainText
$certwithThumb = "cert:\CurrentUser\my\"+$cert.Thumbprint
$filepath = "$certroopath\$certname.pfx"
Export-PfxCertificate -cert $certwithThumb -FilePath $filepath -Password $pwd

【讨论】:

    猜你喜欢
    • 2018-02-05
    • 2020-07-05
    • 2020-01-15
    • 2021-09-11
    • 1970-01-01
    • 1970-01-01
    • 2016-10-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多