Skip to content

Spring Session Redis Integration with GCP IAM #3116

Open
@hk250097

Description

@hk250097

Expected Behavior
Spring Session Redis / Spring Data with Redis to support Google Cloud (GCP) IAM authentication.

Spring Session / Spring Data with redis needs RedisConnectionFactory bean to be injected.
Google Redis Memstore has IAM authentication supported.
RedisConnectionFactory to support the password authentication with GCP IAM
Current Behavior
Not able to find any reference to support the password with GCP IAM

The code is pasted below,
GCP IAM sample as per GCP recommendation is https://cloud.google.com/memorystore/docs/cluster/client-library-connection#lettuce_2
Please refer the line below redisClusterConfiguration.setPassword(char[] seq);
Without this line it doesn't work as redis expected password but the question is how to set the pwd which is generated from GCP IAM.
public RedisConnectionFactory redisConnectionFactory() {
String discoveryEndPointURL = buildDiscoveryEndPointURL();
RedisClusterConfiguration redisClusterConfiguration = new RedisClusterConfiguration(Collections.singletonList(discoveryEndPointURL));
redisClusterConfiguration.setPassword(char[] seq);
LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(redisClusterConfiguration);
lettuceConnectionFactory.afterPropertiesSet();
return lettuceConnectionFactory;
}

Context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions