Infinispan is often used in scenarios where low-latency access to data is critical, such as caching frequently accessed database queries, session data in web applications, or other use cases where quick access to data can improve overall system performance.
Keycloak is an open-source identity and access management solution developed by Red Hat.
Keycloak is designed to simplify the implementation of security protocols and standards such as OAuth 2.0, OpenID Connect, and SAML. Some key features include Single Sign-On, Identity Brokering, User Authentication, User Federation, RBAC, and more.
Keycloak uses Infinispan as its underlying data store for caching and storage purposes.
Infinispan provides scalable and efficient caching of authentication and authorization-related data.
Some ways Keycloak leverages Infinispan include Caching User Sessions, storing Authorization policies, providing distributed caching, improving performance, failover recovering and more.
Infinispan provides several ways to handle authentication and user management.
Token-based authentication is supported, and Keycloak can be used for that purpose.
Because we're going to run Keycloak in one container and Infinispan in another, let's set up a network to connect them.
Keycloak Image will create an administrator user by defining the KEYCLOAK ADMIN and KEYCLOAK ADMIN PASSWORD environment variables.
Keycloak realms are a fundamental concept in Keycloak.
Once we have the two clients created, we need to create an admin user for Infinispan.
The Infinispan Server will be reaching out to the Keycloak Server inside the Docker environment.
Accessing the following URL provides the information used by the Infinispan Web console to handle authentication.
The Infinispan Console will use the information above, and making use of the Keycloak Javascript Adapter, the interface will redirect to Keycloak for user authentication.
When opening the Infinispan Console, Infinispan will attempt to make a call to a REST API that requires authentication.
You'll be redirected to the Keycloak authentication, where you should use the credentials admin/adminPassword.
After Keycloak redirects back to the Infinispan Console, you can verify that the admin is authenticated.
Return to the Infinispan Console, and you'll notice that the admin user is now granted the admin role in Infinispan as well.
Learn more about it in the Keycloak and Infinispan documentation.
This Cyber News was published on feeds.dzone.com. Publication date: Wed, 10 Jan 2024 19:13:06 +0000