…字符(水平省略号)畸形的AAD访问令牌

发布于 2025-02-12 03:26:06 字数 655 浏览 1 评论 0原文

我正在使用MSAL JS对自己的AAD应用程序注册进行OAuth。我会返回访问令牌,但是当我尝试直接访问graphapi或将其交换为graplapi访问令牌时,我会根据我称呼的任何API得到各种不同的错误:

JWT令牌无效或畸形

C#msal graphclient.users ...(不应该与初始访问令牌一起使用,但我很拼命)

invalidauthenticationtoken消息:访问令牌为空。

https://graph.microsoft.com/v1.0/search/search/query (不应该使用最初的访问令牌,但我很拼命)

请求标头必须仅包含ASCII字符。

访问令牌中间有一个“……”符号。叫做 Unicode字符“水平椭圆”(U+2026),是非ASCII。据我了解,这不应该成为任何访问令牌的一部分。而且它不应该是范围/API权限问题?为什么在那里?我在做什么错?

I'm using MSAL JS to do OAuth against my own AAD app registration. I get an access token back, but when I try to access the GraphAPI directly or exchange it for a GraphAPI access token, I get a variety of different errors, based on whichever API I'm calling:

https://login.microsoftonline.com/.../oauth2/v2.0/token, on_behalf_of flow

JWT token is invalid or malformed

C# MSAL GraphClient.Users... (not supposed to work with the initial access token, but I'm desperate)

InvalidAuthenticationToken Message: Access token is empty.

https://graph.microsoft.com/v1.0/search/query (not supposed to work with the initial access token, but I'm desperate)

Request headers must contain only ASCII characters.

The access token has a "…" symbol somewhere in the middle of it. It's called
Unicode Character 'HORIZONTAL ELLIPSIS' (U+2026) and is non ASCII. To my understanding, that should not be part of any access token ever. And it shouldn't be a scope/API permission issue? Why is it there? What am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

揽清风入怀 2025-02-19 03:26:06

我尝试复制&将值从一个应用程序粘贴到另一个应用程序/邮递员。但是,视觉工作室缩短了长字符串,至少在大麻片中添加了三个点字符。我不确定何时缩短字符串,但是对于WebApis来说,放大镜正在出现,让您获得整个字符串。

您可以使用Glazor上的直接窗口围绕它进行操作,或者在浏览器中调试,Chrome不会躺在。

I tried to copy & paste the value from one application to another/to Postman. But Visual Studio shortens long strings, adding the three dots character instead, at least in Blazor. I'm not sure about when strings are being shortened, but for WebAPIs the magnifying glass is showing up, letting you get the entire string.

You can work around it using the Immediate Window on Blazor, or debugging in the browser, Chrome doesn't lie.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文