密钥斗篷令牌生成不起作用-未经授权的凭据



我正在使用spring-boot文档https://www.baeldung.com/spring-boot-keycloak我已经在第4点停了下来,我无法通过POSTMAN生成令牌,也无法卷曲任何建议,尤其是对于上面的文档。我的错误是客户端凭据错误。

卷曲-X POSThttp://localhost:8080/auth/realms/master/protocol/openid-连接/令牌-H";内容类型:application/x-www-form-urlencoded"-d";username=user1"-d";password=Chikodili1〃-d";grant_ type=密码"-d";client_id=登录应用程序";

这对我很有用。我想指出三项,将-X替换为-v选项,并用client_secret添加-d。它是从客户端凭据选项卡上的Keycapture UI获得的,grant_type与"Client_credentials"一起使用

curl -v http://127.0.0.1:8080/auth/realms/Test-realm/protocol/openid-connect/token 
-H "Accept: application/json" 
-d "client_id=RemoteApp" 
-d "client_secret=523b7e5b-3dbd-4f9e-bea1-e9e1d5c62f69" 
-d "grant_type=client_credentials"

最新更新