Microsoft Oauth解析状态参数作为字符串,但返回哈希
我正在使用Microsoft Identity平台和OAuth 2.0授权代码流来授权Microsoft Azure的用户信息。在我的Ruby代码中,我将状态参数解析到Microsoft:
config.omniauth :azure_oauth2, client_id: "xxxxxxxxxxxx", client_secret: "xxxxxxxxxxxx", tenant_id: "xxxxxxxxxxxx", scope: "user.read", state: "development", response_type: "token", response_mode: "query"
我应该接收一个与我发送的相同值(“开发”)的状态参数。但是,在微软收到我的请求之后,我似乎有一个哈希价值:
https://login.microsoftonline.com/xxxxxxxx&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fomniauth%2Fazure_oauth2%2Fcallback&response_type=code&scope=user.read&state=6ff45c77bf433d3bf33dd8df956fda77d62467c0b29b6f4c&sso_reload=true
有什么想法吗?谢谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是根据设计工作的,状态将随机生成的唯一值通常用于预防。该状态还用于编码有关应用程序中用户状态的信息,请参见文档以获取更多详细信息 - https://learn.microsoft.com/en-us/graph/auth-v2-user
This is working as per design , state will randomly generated unique value is typically used for preventing cross-site request forgery attacks. The state is also used to encode information about the user's state in the app , see the docs for more details - https://learn.microsoft.com/en-us/graph/auth-v2-user
