wso2 - WSO2 Identity Server OAuth2 访问令牌请求重定向到登录页面
问题描述
我正在尝试向https://{identity-server}:9443/oauth2/token
. 并且请求被重定向到 Location: https://{identity-server}:9443/carbon/admin/login.jsp
。我使用的版本是 IS 5.7.0,并作为集群设置部署在 Kubernetes 上。
解决方案
您在请求中缺少授权标头。这就是您被重定向到登录页面的原因。
尝试提供这样的授权标头
Authorization: Basic [Base64encode(Client-ID>:<ClientSecret>)]
最终请求应该与此类似
curl -X POST \
https://localhost:9443/oauth2/token \
-H 'Authorization: Basic Zkd2ZlhiQ05VeUFmd2ltQW9HSWYycXZDakdFYTpFb1NOWDdHNFQ2NGZjcVFyZTVIX2NPR01CS2Nh' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'username=admin&password=admin&grant_type=password&scope=bearer'
推荐阅读
- c# - 来自连接不同设备的一个程序实例的多个客户端套接字 - 工作速度非常慢
- android - 通过 Android Studio 手动将文件附加到内部存储
- swift - 使用 Swift 从闭包中捕获一个值(不正常)
- javascript - 为什么我的 JavaScript 第二个计数器不起作用?
- tampermonkey - 有没有办法在 Tampermonkey 上加载所需资源时捕获错误?
- javascript - 无法通过 zip 中的异步读取同时获取 csv 的文件名及其内容
- c# - ASP.NET 5.0 中的脚手架标识错误(没有 MVC 的 WebApp)
- algorithm - 如果 f(n) = O(n) 且 g(n) = O(n),证明 f(g(n)) = O(n)
- java - 有没有办法在java中加倍d + 1 == d
- c# - 从.NET 5 Blazor PostAsJsonAsync中的文件上传获取进度信息/制作进度条