Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redisson usage along with tomcat singlesignon valve #5603

Open
iamrakesh opened this issue Feb 1, 2024 · 3 comments
Open

redisson usage along with tomcat singlesignon valve #5603

iamrakesh opened this issue Feb 1, 2024 · 3 comments

Comments

@iamrakesh
Copy link

Hi,
I am trying to use 'redisson' to manage Tomcat sessions, to be able to have Tomcat cluster setup. In our setup we've multiple webapplications deployed in Tomcat, and use SingleSignOn valve to have user logged into one application once and allow accessing other applications deployed on Tomcat.
When I configure Tomcat to use "org.redisson.tomcat.RedissonSessionManager" using below in context.xml

<Manager className="org.redisson.tomcat.RedissonSessionManager" configPath="${catalina.base}/conf/redisson.conf" broadcastSessionEvents="true" readMode="REDIS" updateMode="DEFAULT"/>

I see that sessions are being pushed to Redis, but the 'cache' in SingleSignOn valve breaks the flow. As per below code, it always looks for principal object in this in memory cache

SingleSignOnEntry entry = cache.get(cookie.getValue()); if (entry != null) { if (containerLog.isDebugEnabled()) { containerLog.debug(sm.getString("singleSignOn.debug.principalFound", entry.getPrincipal() != null ? entry.getPrincipal().getName() : "", entry.getAuthType())); } ........ } else { if (containerLog.isDebugEnabled()) { containerLog.debug(sm.getString("singleSignOn.debug.principalNotFound", cookie.getValue())); } .......

Is the above impl. of SingleSignOn expected work correctly ?
Is there something I am missing, to get this working ?

Thank you

@iamrakesh
Copy link
Author

I was able to get it working, by extending SingleSignOn valve class of Tomcat and serialize/deserialize SingleSignOnEntry objects to redis with additional code.

It would be nice if SingleSignOn valve extension is also provided as part of redisson-tomcat library.

Thank you,
Rakesh.A

@mrniko
Copy link
Member

mrniko commented Feb 5, 2024

Any contributions are welcome.

@iamrakesh
Copy link
Author

Happy to give it a go, I'll add it to my list.
Thank you

@mrniko mrniko reopened this Feb 28, 2024
@mrniko mrniko added this to the 3.27.2 milestone Feb 28, 2024
@mrniko mrniko modified the milestones: 3.27.2, 3.27.3 Mar 14, 2024
@mrniko mrniko modified the milestones: 3.28.0, 3.28.1 Apr 11, 2024
@mrniko mrniko added the tomcat label Apr 16, 2024
@mrniko mrniko modified the milestones: 3.29.0, 3.29.1 Apr 23, 2024
@mrniko mrniko modified the milestones: 3.30.0, 3.30.1 May 14, 2024
@mrniko mrniko modified the milestones: 3.31.0, 3.31.1 May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants