What is the purpose of DISSESSION cookie? looks like some distributed
cookie but do I really need this?
The problem I am having is with delegated login via OIDC to an idp from
CAS. When I hit CAS login page I see DISSESSIONAuthnDelegation cookie
appear. I login fine, cookie remains after login. I logout and hit the log
page again, I then get an "Authorization Denied" with jpa unique constraint
violation:
2025-03-25 16:20:02,267 DEBUG
[org.springframework.orm.jpa.JpaTransactionManager] - <Committing JPA
transaction on EntityManager [SessionImpl(786472226<open>)]>
2025-03-25 16:20:02,312 ERROR
[org.hibernate.engine.jdbc.batch.internal.BatchingBatch] - <HHH000315:
Exception executing batch [java.sql.BatchUpdateException: Batch entry 0
insert into Postgres_Jpa_Ticket_Entity (body, creation_Time, parent_Id,
principal_Id, type, id) values
('{"@class":"org.apereo.cas.ticket.TransientSessionTicketImpl","@id":1,"expirationPolicy":{"@class":"org.apereo.cas.ticket.expiration.MultiTimeUseOrTimeoutExpirationPolicy$TransientSessionTicketExpirationPolicy","numberOfUses":1,"timeToLive":300,"name":"TransientSessionTicketExpirationPolicy-a5eed7c5-6c4f-433c-a292-27d8ae7fa9cf"},"id":"TST-5f791802-cb08-4a8c-8572-268b7a6fed1c","lastTimeUsed":"2025-03-25T21:20:02.2672803Z","creationTime":"2025-03-25T21:20:02.2672803Z","properties":{"@class":"java.util.HashMap","OIDC_CLIENT_ID":"TST-2-********UZ-24eJ6Jjmc8n6E"},"prefix":"TST"}',
'2025-03-25 21:20:02.26728+00', NULL, '',
'org.apereo.cas.ticket.TransientSessionTicketImpl',
'TST-5f791802-cb08-4a8c-8572-268b7a6fed1c') was aborted: ERROR: duplicate
key value violates unique constraint "postgres_jpa_ticket_entity_pkey"
Detail: Key (id)=(TST-5f791802-cb08-4a8c-8572-268b7a6fed1c) already
exists. Call getNextException to see other errors in the batch.], SQL:
insert into Postgres_Jpa_Ticket_Entity (body, creation_Time, parent_Id,
principal_Id, type, id) values (?, ?, ?, ?, ?, ?)>
2025-03-25 16:20:02,312 WARN
[org.hibernate.engine.jdbc.spi.SqlExceptionHelper] - <SQL Error: 0,
SQLState: 23505>
2025-03-25 16:20:02,312 ERROR
[org.hibernate.engine.jdbc.spi.SqlExceptionHelper] - <Batch entry 0 insert
into Postgres_Jpa_Ticket_Entity (body, creation_Time, parent_Id,
principal_Id, type, id) values
('{"@class":"org.apereo.cas.ticket.TransientSessionTicketImpl","@id":1,"expirationPolicy":{"@class":"org.apereo.cas.ticket.expiration.MultiTimeUseOrTimeoutExpirationPolicy$TransientSessionTicketExpirationPolicy","numberOfUses":1,"timeToLive":300,"name":"TransientSessionTicketExpirationPolicy-a5eed7c5-6c4f-433c-a292-27d8ae7fa9cf"},"id":"TST-5f791802-cb08-4a8c-8572-268b7a6fed1c","lastTimeUsed":"2025-03-25T21:20:02.2672803Z","creationTime":"2025-03-25T21:20:02.2672803Z","properties":{"@class":"java.util.HashMap","OIDC_CLIENT_ID":"TST-2-********UZ-24eJ6Jjmc8n6E"},"prefix":"TST"}',
'2025-03-25 21:20:02.26728+00', NULL, '',
'org.apereo.cas.ticket.TransientSessionTicketImpl',
'TST-5f791802-cb08-4a8c-8572-268b7a6fed1c') was aborted: ERROR: duplicate
key value violates unique constraint "postgres_jpa_ticket_entity_pkey"
Detail: Key (id)=(TST-5f791802-cb08-4a8c-8572-268b7a6fed1c) already
exists. Call getNextException to see other errors in the batch.>
2025-03-25 16:20:02,312 ERROR
[org.hibernate.engine.jdbc.spi.SqlExceptionHelper] - <ERROR: duplicate key
value violates unique constraint "postgres_jpa_ticket_entity_pkey"
Detail: Key (id)=(TST-5f791802-cb08-4a8c-8572-268b7a6fed1c) already
exists.>
If I delete the cookie, i can login again.
Setting this property to false, avoid the cookie from being set. I can
login over and over without issue.
cas.authn.pac4j.core.session-replication.replicate-sessions=false
I'm running CAS with multiple ECS containers deployed with Infinispan
managing the session. Is disabling replicated-session okay in this case?
But it would be nice if I can resolve the root cause of the unique
constraint violation.
-psv
--
- Website: https://apereo.github.io/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/6458b147-531d-4bea-9186-b83d3ba329ecn%40apereo.org.