【问题标题】:Microsoft identity platform and OAuth 2.0 authorization code flow (PKCE) - Error "AADSTS700025"Microsoft 身份平台和 OAuth 2.0 授权代码流 (PKCE) - 错误“AADSTS700025”
【发布时间】:2022-02-24 17:36:31
【问题描述】:

尝试按照微软的说明获取访问令牌。但我收到一个错误,因为没有解决方案的答案。 我做错了什么,这在我的情况下意味着什么? enter image description here 要求: https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize *auth_code : client_id & response_type & redirect_uri & response_mode & scope & code_challenge & code_challenge_method。

https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token *获取访问令牌:client_id & scope & code & redirect_uri & grant_type & code_verifier & client_secret.(Content-Type: application/x-www-form-urlencoded) redirect_uri == 在这两种情况下都是一样的。

在第一个请求中可以获得 auth_code,但是当我尝试使用此 auth_code 获取访问令牌时,我得到:错误“AADSTS700025”客户端是公共的,因此不应显示“client_assertion”和“client_secret”。 但我使用 client_secret 而不是 client_assertion_type 和 client_assertion。 按照微软的指示...

【问题讨论】:

标签: oauth-2.0 azure-active-directory authorization


【解决方案1】:

重现与您面临的相同类型的问题(因为我正在使用 AuthCode 生成访问令牌)

解决方案--

Aussming 你使用 grant_typeclient_credentials 使用以下 API 获取访问令牌:

https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token

要获得 access token,您不需要 AuthCode,您只能通过客户凭证获得它。请按照我在 Body 中的下图进行配置。

【讨论】:

    猜你喜欢
    • 2021-04-09
    • 2020-11-07
    • 1970-01-01
    • 2016-10-15
    • 2020-03-01
    • 2014-12-27
    • 2020-11-27
    • 2021-04-01
    • 2018-08-05
    相关资源
    最近更新 更多