Setting up Redis
The Onegini IdP uses a Redis cache to temporarily store various pieces of data during runtime. It means that the application requires the Redis properties to be configured and defined in order to boot.
This chapter will walk you through the available configuration options and supported modes.
The sections below describe the deprecated properties that were required in older Onegini IdP versions and the current way of configuring Redis.
Deprecated configuration properties
Prior to version 6.10 of the Onegini IdP the following Redis properties were mandatory:
These variables were expected to be configured in the Onegini IdP Extension application and required a Redis Sentinel setup to be available.
When using this configuration other Redis modes (
cluster) are not supported.
Current configuration properties
As of 6.10 version of the Onegini IdP the above properties got deprecated in favour of the default Spring Data Redis configuration properties. These changes make the Redis integration more flexible and future proof.
Depending on how you have setup your Redis instance(s) you should provide the appropriate configuration properties.
Note: The newly introduced configuration properties MUST be provided to the Onegini IdP container and NOT the Onegini IdP Extension container.
You can set the key prefix for Redis to use on all keys. This is used as a 'namespace' for grouping inside a cache (and to avoid collision with other caches or keys inside Redis). You can configure it using this property:
If you are targeting your setup against a single Redis node or the AWS ElastiCache you MUST at least provide the properties specified below:
- SPRING_REDIS_HOST - Redis server host
- SPRING_REDIS_PORT - Redis server port
Given you want to connect to a Redis cluster and do have direct access to all of the nodes you MUST provide the variables below at minimum:
- SPRING_REDIS_CLUSTER_NODES - A comma-separated list of "host:port" pairs to bootstrap from. This represents an "initial" list of cluster nodes and is required to have at least one entry.
Note: We currently don't support the cluster mode for AWS ElastiCache.
You can also still connect the Onegini IdP with Redis Sentinel using the new configuration properties. In such case you must at least provide the property specified below:
- SPRING_REDIS_CLUSTER_NODES - Comma-separated list of "host:port" pairs.
Additionally the Onegini IdP will accept any other configuration properties that are supported by the Spring Data Redis module. Please refer to to the official Spring data redis documentation for more info.