【问题标题】:Access Azure WebApp with Powershell {"message":"Missing id token. Unauthorized."}使用 Powershell {"message":"Missing id token. Unauthorized."} 访问 Azure WebApp
【发布时间】:2022-01-04 14:14:21
【问题描述】:

我在 Azure 中创建了一个启用了 Azure 身份验证的 WebApp。我想使用here 所述的客户端密码访问此 Web 应用程序。

所以我使用了与答案中相同的脚本,但我在最后一个 invoke-RestMethod 上有一个错误:

invoke-RestMethod : {"message":"Missing id token. Unauthorized."}

如何解决这个问题?仅供参考我的$authenticationToken最后是

authenticationToken : eyJhbGci...
user                : @{userId=sid:dcc5f...7f37ec9}

任何帮助将不胜感激。

【问题讨论】:

    标签: azure powershell authentication web-applications token


    【解决方案1】:

    在您链接到的帖子中,您使用 grant_type=client_credentials,这意味着您使用 clients 凭据流程

    使用此流程,您有没有 id-token,因为不涉及任何用户。此流/授权类型仅用于机器对机器通信。

    另外,关于 id-token 很重要(如果您使用的是代码流),您不应该将 Id-token 传递给其他服务。如果您收到一个,那么您通常使用它来创建本地用户会话。

    【讨论】:

      猜你喜欢
      • 2020-03-05
      • 2017-05-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-30
      • 1970-01-01
      • 2016-05-06
      • 1970-01-01
      相关资源
      最近更新 更多