• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Mister PKI

SSL Certificates * SSL Tools * Certificate Decoder

  • PKI Training
  • OpenSSL
  • Keytool
  • PKI Tools
    • Apereo CAS
    • SAML
    • OpenID Connect
  • Get expert help

Apereo CAS – Terminate User sessions

November 8, 2024 by Mister PKI Leave a Comment

As an administrator of the Apereo CAS IDP (Identity Provider) you may find it useful to terminate user sessions for any number of reasons. Let’s say the underlying authentication platform is LDAP, either Active Directory or OpenLdap and you do not wish to disable the account but only terminate the user’s session in CAS. This article will demonstrate just how to do that.

Enable Actuator Endpoints

First, you must have the actuator endpoint for user sessions enabled. This example uses the Slurp configuration with Groovy, making it easier to use one config file for multiple environments. If you are not using the cas.groovy file, use the property type for your environment.

/* ssoSessions specific */
management.endpoint.ssoSessions.enabled="true"
cas.monitor.endpoints.endpoint.ssoSessions.access="AUTHENTICATED"
management.endpoints.web.exposure.include="ssoSessions"
/* Spring security basic auth */
spring.security.user.name="username"
spring.security.user.password="password"

In the above properties, the ssoSessions endpoint is enabled, access set to require authentication, and endpoint exposed. The spring security config will be used to authenticate to the endpoint.

GET SSO Sessions

Get all SSO Sessions

Using curl, get the sso sessions.

curl -k https://login.example.com/cas/actuator/ssoSessions

Get SSO Sessions for a single user

curl -k https://login.example.com/cas/actuator/ssoSessions/users/<username>

Where username is the username for the user you are getting all sso sessions for.

Delete single SSO session for a user

curl -k -X DELETE https://login.example.com/cas/actuator/ssoSessions/TGT-2-.....

Where TGT-2-….. is the TGT found in one of the previous GET requests. Note that the path in this delete does not include the username. It is simply deleting a session by TGT.

Delete all SSO sessions for a user

curl -k -X DELETE https://login.example.com/cas/actuator/ssoSessions/users/<username>

Where <username> is the username you are deleting all sessions for.

Delete all SSO sessions

In the event you want to delete all active SSO sessions you have a few different options depending on your ticket registry.

Default in memory registry – Restart your CAS server

Redis Ticket Registry – Run this in your redis instance – redis-cli FLUSHDB

Conclusion – Apereo CAS – Terminate User sessions

This article has demonstrated how to view and delete sso sessions in Apereo CAS using the actuator endpoints. Let us know in the comments if you have any questions or would like to see more examples on how to administer Apereo CAS.

Apereo CAS,  Identity Management

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Popular Posts

PKCS12

openssl s_client

Keytool

Keytool list

ECDSA vs RSA

OpenSSL

PKCS7

Certificate Decoder

PKI for DevOps Engineers – Free Training Series

PKI for DevOps Training Hub

Lesson 1 – How TLS and PKI Work

Lesson 2 – Understanding X.509 Certificates

Lesson 3 – Certificate Chains Explained

Lesson 4 – Debug TLS with OpenSSL

Lesson 5 – Verify Certificate Chains

Lesson 6 – Creating CSRs with OpenSSL

Lesson 7 – Working with PKCS12 Certificates

Lesson 8 – Java Keystores and keytool

Lesson 9 – Certificate Expiration Monitoring

Lesson 10 – Automating Certificate Renewal

Lesson 11 – Common TLS Errors

Lesson 12 – PKI Architecture for DevOps

Recent Posts

  • Apache mod_auth_cas: Protect Web Applications with Apereo CAS and Docker
  • Apache mod_auth_mellon: Configure SAML SSO & Docker
  • Configure OpenID Connect (OIDC) in Apereo CAS 7.3 and 8
  • Certificate Ownership Is an Operating Model Problem, Not a Tooling Problem
  • OpenSSL dgst: Create Checksums and Verify Digital Signatures

Footer

  • Twitter
  • YouTube
Mister PKI

Practical security engineering for the systems that establish trust.

Learn OpenSSL Keytool Free training
Work together PKI consulting CAS consulting Sponsored contributions
Site About Support Mister PKI Cookie policy Search
© 2026 Mister PKI Secure systems. Clear guidance.