Redis ticket registry 7.0.0-RC8 - Azure cache for Redis support

74 views
Skip to first unread message

Mike Rokitka

unread,
Oct 16, 2023, 1:13:06 AM10/16/23
to CAS Community
Hi,

We are currently testing CAS v7 via the latest RC8, but have run into a blocker with the configuration of the Redis based ticket registry.  There does not appear to be a way to configure the Redis registry/client to connect without a username (Azure cache for Redis does not use usernames).  If we set the username to an empty string via configuration properties (or null programmatically), then it fails due to username assertions in lettuce.  
Eg. 

Caused by: java.lang.IllegalArgumentException: User name must not be null
        at io.lettuce.core.internal.LettuceAssert.notNull(LettuceAssert.java:71)
        at io.lettuce.core.RedisURI$Builder.withAuthentication(RedisURI.java:1563)
        at org.apereo.cas.redis.core.RedisObjectFactory.newRedisModulesCommands(RedisObjectFactory.java:132)

This can be traced to RedisObjectFactory.newRedisModulesCommands() in cas-server-support-redis-core, as it assumes a username is present if a password is present (via uriBuilder.withAuthentication call).  This should check for a null/empty username first and use uriBuilder.withPassword instead in that case.

Yan Zhou

unread,
Mar 25, 2024, 9:43:40 AM3/25/24
to CAS Community, Mike Rokitka
Hi Mike,

How is it going now?  did you ever make it work?

Mine is 6.6.x, it should be functional equivalent to CAS7 as far as this code is concerned, i am getting "Unable to connect to ...." message.  I verified that i am using Redis Standalone config, which is suitable for Azure Cloud for Redis.

Yan

Reply all
Reply to author
Forward
0 new messages