Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to get user Information by keycloak-admin-client

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the knowledge of "how to obtain user information from keycloak-admin-client". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Keycloak-admin-client is only a layer of encapsulation of the official interface, and it feels like it is based on Keycloak for secondary development. Generally, to obtain user information or token, you only need to use OpenID Endpoint Configuration. If you only integrate Keycloak, you can directly use the official adapter.

Keycloak keycloak = Keycloak.getInstance (serverUrl,realm,clientId,authToken)

UserRepresentation clients = keycloak.realm (realm). Users (). Get (uid). ToRepresentation ()

Log.info (clients.toString ())

Keycloak keycloak = KeycloakBuilder.builder ()

.serverUrl ("xxxx")

.realm ("xxxx")

.clientId ("xxx")

.clients (token)

.build ()

UserRepresentation clients = keycloak.realm (realm). Users (). Get (uid). ToRepresentation ()

Log.info (clients.toString ())

Reference address:

Https://github.com/keycloak/keycloak/blob/master/examples/admin-client/src/main/webapp/index.jsp

Https://www.keycloak.org/docs/latest/server_development/index.html#admin-rest-api

Https://github.com/keycloak/keycloak-quickstarts/blob/latest/app-authz-rest-springboot/src/test/java/org/keycloak/quickstart/springboot/MyAppTest.java

That's all for the content of "how to get user Information from keycloak-admin-client". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report