Skip to content
SHC Docs

shc user logout

end a user’s SSO sessions and revoke their issued tokens

End every Keycloak SSO session the named user holds, and revoke the access tokens already issued from them.

This is the revocation verb. Ending the IdP session alone is not enough: SHC’s gate carries a self-contained signed bearer that stays cryptographically valid until it expires, so a token issued before this command runs would keep opening doors for the remainder of its lifespan. This records the revocation as well, which is what makes the effect immediate rather than eventual.

It is a revocation, not a lockout: the user can log in again straight away and their new session works. To stop them logging back in, disable or remove the account.

To clear the tokens stored on this machine instead, use shc auth logout: that verb is local and needs no Keycloak.

shc user logout <username> [flags]
-h, --help help for logout
-t, --tenant string target tenant (required for platform admins)
--config stringArray extra YAML config file to layer on top of auto-discovered config; repeatable, later files win
-d, --debug enable debug mode (default: $SHC_DEBUG)
-e, --environment string environment name (default: "prod", or "default" on an estate with no licence and no trial; $SHC_ENVIRONMENT and shc ctx -e override it, and the "master" tenant is always "default")
--exclude string comma-separated dotted paths to drop
--fields string comma-separated columns/keys to show (and their order)
--filter string comma-separated dotted paths to keep (drops everything else)
-o, --output string output format: tty|text|json|yaml (default: $SHC_OUTPUT)
-s, --stack string stack name (default: $SHC_STACK)
-v, --verbose verbose output (default: $SHC_VERBOSE)
  • shc user - manage users and access roles