Need advice about which tool to choose?Ask the StackShare community!
Amazon Cognito vs Keycloak: What are the differences?
Amazon Cognito and Keycloak are both identity management solutions that provide authentication and authorization services. Let's explore the key differences between them.
Integration with Cloud Services: Amazon Cognito is tightly integrated with various Amazon Web Services (AWS) offerings, making it an ideal choice for applications running on the AWS cloud infrastructure. On the other hand, Keycloak is a standalone open-source solution that can be deployed on different platforms, including private clouds and on-premises servers.
Pricing Model: The pricing model of Amazon Cognito is based on active users, where you are charged according to the number of monthly active users. Keycloak, being an open-source solution, has no licensing costs and provides more flexibility in terms of scaling and customizations without incurring additional costs.
Ease of Use and Configuration: Amazon Cognito is known for its ease of use and seamless integration with other AWS services. It provides a simple and intuitive user interface for managing user pools, groups, and app integrations. Keycloak, while offering a similar range of features, may require more configuration and customization to meet specific requirements due to its standalone nature.
User Storage and Management: Amazon Cognito provides built-in user storage and management capabilities, allowing you to create user pools, handle user registration, login, and authentication. Keycloak, on the other hand, does not offer built-in user storage and requires integration with pre-existing external identity providers or databases for user management.
Authentication Providers: Amazon Cognito supports various authentication providers, including social logins (such as Google and Facebook), SAML, and OpenID Connect. Keycloak, being an open-source solution, also supports a wide range of authentication protocols and allows the integration of custom authentication providers.
Support and Documentation: Amazon Cognito is backed by AWS, providing reliable support channels and comprehensive documentation. Keycloak, being open-source, relies on community support, and while the community is vibrant and active, the level of support may vary depending on the availability of community members.
In summary, Amazon Cognito is tightly integrated with AWS services, offering seamless authentication and authorization for cloud-based applications, while Keycloak, an open-source identity and access management system, provides a more extensible and self-hosted solution suitable for a variety of environments.
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/)
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.
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.
I started our team on Amazon Cognito because I was a Solutions Architect at AWS and found it really easy to follow the tutorials and get a basic app up and running with it.
When our team started working with it, they very quickly became frustrated because of the poor documentation. After 4 days of trying to get all the basic passwordless auth working, our lead engineer made the decision to abandon it and try Auth0... and managed to get everything implemented in 4 hours.
The consensus was that Cognito just isn't mature enough or well-documented, and that the implementation does not cater for real world use cases the way that it should. I believe Amplify has made some of this simpler, but I would still recommend Auth0 as it's been bulletproof for us, and is a sensible price.
Pros of Amazon Cognito
- Backed by Amazon14
- Manage Unique Identities7
- Work Offline4
- MFA3
- Store and Sync2
- Free for first 50000 users1
- It works1
- Integrate with Google, Amazon, Twitter, Facebook, SAML1
- SDKs and code samples1
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
Sign up to add or upvote prosMake informed product decisions
Cons of Amazon Cognito
- Massive Pain to get working4
- Documentation often out of date3
- Login-UI sparsely customizable (e.g. no translation)2
- Docs are vast but mostly useless1
- MFA: there is no "forget device" function1
- Difficult to customize (basic-pack is more than humble)1
- Lacks many basic features1
- There is no "Logout" method in the API1
- Different Language SDKs not compatible1
- No recovery codes for MFA1
- Hard to find expiration times for tokens/codes1
- Only paid support1
Cons of Keycloak
- Okta7
- Poor client side documentation6
- Lack of Code examples for client side5