ERROR: "invalid_client" with "AADSTS700025: Client is public so neither 'client_assertion' nor 'client_secret' should be presented

ERROR: "invalid_client" with "AADSTS700025: Client is public so neither 'client_assertion' nor 'client_secret' should be presented

在使用 msal 库授权 Microsoft Graph 应用程序期间, 我遇到以下错误:

"error": "invalid_client", "error_description": "AADSTS700025: Client is public so neither 'client_assertion' nor 'client_secret' should be presented.
"error_codes": [700025] 

有人可以帮忙吗?

由于您的 Web 应用程序将后端用作 Django,将前端用作 Angular,您可以将重定向 URI 平台用作单页应用程序

您需要在 SPA 应用程序中使用 MSAL.js 身份验证来获取访问令牌。

然后您的后端 Django 应用程序验证访问令牌

注意:如果使用MSAL.jsv2.x,需要使用授权码流

参考Migrate JavaScript single-page app from implicit grant to authorization code flow - Microsoft identity platform | Microsoft Docs