使用 Vue 身份验证的 Azure AD

问题描述 投票:0回答:1

我正在尝试为 Microsoft Entra 身份验证配置 vue-authenticate oauth2,但收到错误:

Message: AADSTS9002325: Proof Key for Code Exchange is required for cross-origin authorization code redemption.
vue.js azure-active-directory vue-authenticate
1个回答
0
投票

找到了一个解决方法,将

response_type
改为
token
而不是
code

oauthType: '2.0',
responseType: 'token',
responseParams: {
  code: 'code',

但这返回的是调用 Graph API 所需的

access_token
,而不是更适合您自己的 API 的身份验证和授权的
id_token
。另请参阅 Azure 身份验证 - 访问令牌返回错误的 AUD(00000003-0000-0000-c000-000000000000)

该库默认使用显式流程,首先返回代码,然后您需要使用自己的服务器实现来交换令牌。这是更安全的过程。

© www.soinside.com 2019 - 2024. All rights reserved.