简体   繁体   English

使用java绕过带有rest api的keycloak登录系统并生成领域/应用程序URL

[英]Bypass keycloak login system with rest api using java and generate realm/application URL

I am trying to integrate apiman in my project.我正在尝试将apiman集成到我的项目中。 I am able to do following things with simple java program ( REST api ),我可以使用简单的 Java 程序(REST api)执行以下操作,

  1. Create user for keycloak realm为 keycloak 领域创建用户
  2. Assign role for user.为用户分配角色。
  3. Able to login in apiman with those credentials.能够使用这些凭据登录 apiman。

Things I am not being able to do ,我不能做的事情,

  1. Authenticate user with rest api like keycloak does it from UI ( like the following image )像keycloak一样使用rest api对用户进行身份验证从UI执行(如下图)
  2. Generate session details and then generate URL for that realm and redirect to that project.生成会话详细信息,然后为该领域生成 URL 并重定向到该项目。
  3. Not able able to directly login into the apiman system.无法直接登录apiman系统。

Basically I want to bypass keycloak login system with REST API using java.基本上我想使用java绕过带有REST API的keycloak登录系统。

在此处输入图片说明

I want to directly go into this screen.我想直接进入这个画面。 I am not able to find any way by which I can generate or authenticate user in keycloak and generate url for the below screen ( apiman ) and then redirect the user on the below screen using that URL.我找不到任何可以在 keycloak 中生成或验证用户并为下面的屏幕( apiman )生成 url 的方法,然后使用该 URL 在下面的屏幕上重定向用户。 在此处输入图片说明

I am first experience the ApiMan.我是第一次体验 ApiMan。 But it works this URL.但它适用于这个 URL。

http://localhost:8080/apimanui/api-manager/ http://localhost:8080/apimanui/api-manager/

It turns to ApiMan Login screen.它变成 ApiMan 登录屏幕。 在此处输入图片说明

Then I enter new user id and password然后我输入新的用户名和密码在此处输入图片说明

It goes to this screen.它进入这个屏幕。 在此处输入图片说明

I follow ApiMan's steps.我遵循 ApiMan 的步骤。 http://www.apiman.io/latest/download.html http://www.apiman.io/latest/download.html

mkdir ~/apiman-2.0.0.Final
cd ~/apiman-2.0.0.Final
curl -L https://download.jboss.org/wildfly/20.0.1.Final/wildfly-20.0.1.Final.zip -o wildfly-20.0.1.Final.zip
curl -L https://github.com/apiman/apiman/releases/download/2.0.0.Final/apiman-distro-wildfly-2.0.0.Final-overlay.zip -o apiman-distro-wildfly-2.0.0.Final-overlay.zip
unzip wildfly-20.0.1.Final.zip
unzip -o apiman-distro-wildfly-2.0.0.Final-overlay.zip -d wildfly-20.0.1.Final
cd wildfly-20.0.1.Final
./bin/standalone.sh -c standalone-apiman.xml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM