0

我尝试使用 shell 脚本登录到由 Keycloak Gatekeeper 保护的 Web 应用程序。登录正在工作,并且令牌句柄显示正确的数据。但是当我执行“真实”请求时,X-Auth-* 标头不存在,因此上游应用程序无法检查授权。

# login
wget --save-cookies .cookie --keep-session-cookies -qO/dev/null --post-data='username=...&password=...' "$URL/oauth/login"
# verify the token data (correct)
wget --load-cookies .cookie -q  -O- "$URL/oauth/token"
# request data (no X-Auth headers present)
wget --load-cookies .cookie -nv -O- "$URL/path/to/data"

通过浏览器通过代码流进行登录时,标题设置正确。

4

1 回答 1

0

X-Auth-*标头被添加到请求from the gatekeeper to the upstream app中。您正在检查user - gatekeeper连接,因此这些标头不存在是正确的。

于 2020-01-30T11:08:57.243 回答