…字符(水平省略号)畸形的AAD访问令牌
我正在使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我尝试复制&将值从一个应用程序粘贴到另一个应用程序/邮递员。但是,视觉工作室缩短了长字符串,至少在大麻片中添加了三个点字符。我不确定何时缩短字符串,但是对于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.