| LEMONLDAP-NG-SESSIONS(1p) | User Contributed Perl Documentation | LEMONLDAP-NG-SESSIONS(1p) |
lemonldap-ng-sessions - Scripting CLI for LemonLDAP::NG sessions
lemonldap-ng-sessions [<options>] <command> [<arguments> ...]
Commands:
Options:
get
lemonldap-ng-sessions get <id> [<id> ...]
This command lets you read the content of a session.
You must pass one or several session IDs as parameters.
Examples
lemonldap-ng-sessions get 9684dd2a6489bf2be2fbdd799a8028e3
lemonldap-ng-sessions get --persistent dwho
search
lemonldap-ng-sessions search [<options>]
This command lets you search for sessions.
It can be used to find the session IDs that other commands need.
You can restrict the search with options. See "OPTIONS"
Examples
lemonldap-ng-sessions search
lemonldap-ng-sessions search --backend persistent
lemonldap-ng-sessions search --where uid=dwho
lemonldap-ng-sessions search --where uid=dwho \
--id-only
lemonldap-ng-sessions search --backend persistent \
--where _session_uid=dwho
lemonldap-ng-sessions search --where uid=dwho \
--select authenticationLevel
lemonldap-ng-sessions search --where '_startTime>20240410063538'
lemonldap-ng-sessions search --where '_startTime<20240410063538'
And you can just display the number of result using lemonldap-ng-sessions search --count
delete
lemonldap-ng-sessions delete <id> [<id> ...]
lemonldap-ng-sessions delete --where <filter>
This command lets you delete sessions.
You may give it one or several session IDs to remove.
Examples:
lemonldap-ng-sessions delete 9684dd2a6489bf2be2fbdd799a8028e3
lemonldap-ng-sessions delete --persistent dwho
Or you can give it a search expression.
Examples:
lemonldap-ng-sessions delete --where uid=dwho
lemonldap-ng-sessions delete --persistent --where _session_uid=dwho
setKey
lemonldap-ng-sessions setKey <id> <key> <value> [<key> <value> ...]
This command allows you to modify one or several keys from an existing session.
Examples:
lemonldap-ng-sessions setKey 9684dd2a6489bf2be2fbdd799a8028e3 \
authenticationLevel 1
delKey
lemonldap-ng-sessions delKey <id> <key> [<key> ...]
This command lets you remove a key from an existing session.
You must specify a session ID, and one of several session keys to remove.
Examples:
lemonldap-ng-sessions delKey --persistent dwho _oidcConsents
secondfactors
lemonldap-ng-sessions secondfactors <command> <user> [<id> ... ]
Commands:
consents
lemonldap-ng-sessions consents <command> <user> [<id> ... ]
Commands:
get <user>
show all OIDC consents for a user
delete <user> <id> [<id> ...]
delete OIDC consents for a user
backup
lemonldap-ng-sessions backup > file
# or
lemonldap-ng-sessions backup --out file
# or limited to persistent sessions
lemonldap-ng-sessions backup --persistent --out file
# or limited to OIDC refresh_tokens
lemonldap-ng-sessions backup --refresh-tokens --out file
Simple command to dump all sessions or only persistent or refresh_tokens.
restore
lemonldap-ng-sessions restore < file
# or
lemonldap-ng-sessions restore file
Command to restore sessions using a file generated by "backup" command
This option can be set multiple times
For now, only one filter can be set.
Examples:
--search uid=dwho
--search _sessionType=OIDC
--search '_startTime>20240410063538'
--search '_startTime<20240410063538'
You only need it when you configured multiple session backends in your LemonLDAP::NG installation (for Persistent, SAML, CAS or OIDC sessions)
Examples:
--backend persistent
--backend saml
--backend oidc
--backend cas
Example:
lemonldap-ng-sessions --backend persistent \
get 5efe8af397fc3577e05b483aca964f1b
is the same as
lemonldap-ng-sessions get --persistent dwho
This allows some interesting combos using xargs. For example, if you want to remove all sessions started by "dwho"
lemonldap-ng-sessions search --where uid=dwho --id-only | \
xargs lemonldap-ng-sessions delete
<http://lemonldap-ng.org/>
Use OW2 system to report bug or ask for features: <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues>
This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
| 2025-11-02 | perl v5.40.1 |