Need advice about which tool to choose?Ask the StackShare community!
Keycloak vs OpenID Connect: What are the differences?
Introduction
Keycloak and OpenID Connect are both authentication frameworks used in website development. While they have similarities in terms of their purpose, there are key differences between the two.
Token-Based Authentication vs Identity Federation: One of the main differences between Keycloak and OpenID Connect is their approach to authentication. Keycloak uses a token-based authentication system, where users receive access and refresh tokens that are used for authorization. On the other hand, OpenID Connect focuses on identity federation, allowing users to use their existing identities from other identity providers to log in to a website.
Server-Side vs Client-Side Authentication: Another notable difference is the location of the authentication process. Keycloak performs authentication on the server-side, meaning that the authentication logic resides on the server. In contrast, OpenID Connect primarily focuses on client-side authentication, where the authentication logic is implemented on the client-side using JavaScript libraries.
User Management and Administration: Keycloak offers a comprehensive set of user management and administration features, allowing administrators to manage users, roles, and permissions within the Keycloak realm. OpenID Connect, on the other hand, does not provide built-in user management and administration capabilities. It relies on external identity providers to handle these functionalities.
Standards-Based vs Protocol: Keycloak follows a standards-based approach, implementing the OAuth 2.0 and OpenID Connect specifications. It provides support for other standards such as SAML, LDAP, and more. OpenID Connect, on the other hand, is a protocol built upon OAuth 2.0, providing a standardized way for clients to access user identity information from an identity provider.
Interoperability and Vendor Lock-In: Keycloak offers greater interoperability with other systems and technologies due to its adherence to standards-based protocols. It enables seamless integration with various components of the application stack. OpenID Connect, although widely adopted and supported, might lead to vendor lock-in as it introduces some implementation-specific features.
Scalability and Performance: Keycloak is known for its scalability and high-performance capabilities, with features like clustering, session store caching, and database connection pooling. This ensures that Keycloak can handle a large number of concurrent users and heavy workloads effectively. OpenID Connect's scalability and performance depend on the identity provider being used, as different providers have varying capabilities and requirements.
In summary, Keycloak focuses on token-based authentication, server-side authentication logic, comprehensive user management, standards-based protocols, interoperability, scalability, and performance. OpenID Connect emphasizes identity federation, client-side authentication logic, relies on external providers for user management, uses a specific protocol, and has varying levels of interoperability and scalability depending on the identity provider.
I am working on building a platform in my company that will provide a single sign on to all of the internal products to the customer. To do that we need to build an Authorisation server to comply with the OIDC protocol. Earlier we had built the Auth server using the Spring Security OAuth project but since in Spring Security 5.x it is no longer supported we are planning to get over with it as well. Below are the 2 options that I was considering to replace the Spring Auth Server. 1. Keycloak 2. Okta 3. Auth0 Please advise which one to use.
It isn't clear if beside the AuthZ requirement you had others, but given the scenario you described my suggestion would for you to go with Keycloak. First of all because you have already an onpremise IdP and with Keycloak you could maintain that setup (if privacy is a concern). Another important point is configuration and customization: I would assume with Spring OAuth you might have had some custom logic around authentication, this can be easily reconfigured in Keycloak by leveraging SPI (https://www.keycloak.org/docs/latest/server_development/index.html#_auth_spi). Finally AuthZ as a functionality is well developed, based on standard protocols and extensible on Keycloak (https://www.keycloak.org/docs/latest/authorization_services/)
We have good experience using Keycloak for SSO with OIDC with our Spring Boot based applications. It's free, easy to install and configure, extensible - so I recommend it.
You can also use Keycloak as an Identity Broker, which enables you to handle authentication on many different identity providers of your customers. With this setup, you are able to perform authorization tasks centralized.
Pros of Keycloak
- It's a open source solution33
- Supports multiple identity provider24
- OpenID and SAML support17
- Easy customisation12
- JSON web token10
- Maintained by devs at Redhat6
Pros of OpenID Connect
Sign up to add or upvote prosMake informed product decisions
Cons of Keycloak
- Okta7
- Poor client side documentation6
- Lack of Code examples for client side5