curl - 刷新 keycloak 访问令牌给出 ssl3_get_record:wrong version number
问题描述
我正在尝试使用来自 keycloak 的刷新令牌。我可以通过 curl 使用原始访问令牌并从我的应用程序接收数据。但是当它尝试使用我的刷新令牌获取新的访问令牌时,
$ curl -v --data "grant_type=refresh_token&client_id=bikes-app&refresh_token=$RTOKEN" https://mint191:8080/auth/realms/SpringBootKeycloak/protocol/openid-connect/token
* Trying 127.0.1.1...
* TCP_NODELAY set
* Connected to mint191 (127.0.1.1) port 8080 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* error:1408F10B:SSL routines:ssl3_get_record:wrong version number
* Closing connection 0
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number
$ echo $RTOKEN eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUI......A8dS93p6bzqg
我得到了原始令牌
结果=
curl -s -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d 'username=user1&grant_type=password&client_id=bikes-app&password=123456' http://mint191:8080/auth/realms/SpringBootKeycloak/protocol/openid-connect/token
然后获取令牌并刷新令牌变量。然后我可以使用令牌从应用程序访问数据。
补充一点,我不在代理后面(这似乎是stackoverflow上其他示例中的原因)。如果我可以获得访问和刷新令牌,那么我应该能够使用刷新令牌。
解决方案
我的错误。
我在 https 而不是 http 上要求刷新令牌。
推荐阅读
- python - 如何使用 geopandas 有效地在多边形查询中做一个点?
- node.js - 流星读取文件同步问题
- python - 有没有办法在 Visual Studio Code 中可视化泡菜文件?
- java - 赋值后对象类型保持为 LinkedHashMap
- r - 将图例添加到 ordirgl {vegan3d}
- visual-studio-code - extensionHostProcess.js 丢失,扩展在自动更新到最新版本后停止工作
- asp.net-core - Autofac:带有 RouteValues 的 ITenantIdentificationStrategy
- x86 - 将扫描码转换为 ASCII
- javascript - 方法在附加到 html 时跳过一个项目
- three.js - (三.js)bloom over不bloom问题