spring-boot - 如何通过 Keycloak REST API 获取访问令牌
问题描述
我正在尝试在我的 Spring Boot 应用程序中使用 Keycloak Rest API 获取访问令牌,
这是我使用 post 方法传入 Postman 的 URL,
http://localhost:8180/auth/realms/springboot/protocol/openid-connect/token ,
这里测试是我的领域,在正文部分作为 www-form-urlencoded 内容类型,我已经通过用户名,密码,client_id,grant_type 作为密码,我已经在管理控制台中完成了部分,还设置了领域和其他事情,响应我我正在邮递员中找不到 404,
预期的输出是访问令牌。
----
here is my configuration in my app
keycloak.auth-server-url=http://localhost:8180/auth
keycloak.realm=springboot
keycloak.resource=springboot
keycloak.public-client=true
keycloak.security-constraints[0].authRoles[0]=user
keycloak.security-constraints[0].securityCollections[0].patterns[0]=/save/*
----
解决方案
推荐阅读
- excel - 将用户名(数组)与电子邮件(数组)匹配
- subtyping - 如果 A 是 B 的子类型,那么 (A→B) → A 是否是 (B→B) → A 的子类型?
- python - 如何在 Kivy 中显示数独板?
- javascript - 编写一个函数来检测链表中的循环(弗洛伊德的算法)......逻辑看起来正确但找不到错误
- python - Pandas groupby 链接:将多索引列重命名为一行
- scala - Scala 如何允许使用类型参数而不是类型类进行覆盖
- sql - Running SSIS Solution/Package deletes components out of the Data Flow Task
- java - JSP 向 Angular 6+ UI 提供信息
- dart - 如何使用方法通道将任何 T 类型的列表从 Android 发送到 Flutter 端?
- ios - Xcode 项目设置阻止 iPhone X 型号底部的 TabBar?