Skip to content

User Session Management

mbarto edited this page Jul 25, 2014 · 1 revision

Session Management REST API

Create a new Session (with no expiration)

The request needs authentication. The session will be bound to the authenticating user. If successful a session id is returned.

curl -X PUT -u <user>:<password> "http://<server>:<port>/<app>/mvc/session/"

Create a new Session (with expiration)

The request needs authentication. The session will be bound to the authenticating user. If successful a session id is returned.

curl -X PUT -u <user>:<password> "http://<server>:<port>/<app>/mvc/session/?expires=<ISO 8601 date>"

an example of ISO 8601 datetime is: 1994-11-05T13:15:30Z

Get user data from Session id

The request does not need authentication. If successful user details data in json format is returned.

curl -X GET "http://<server>:<port>/<app>/mvc/session/user/<session_id>"

Get user name from Session id

The request does not need authentication. If successful username text format is returned.

curl -X GET "http://<server>:<port>/<app>/mvc/session/username/<session_id>"

Remove session from Session id

The request needs authentication. Only the user bound to the session or any user with the ROLE_ADMIN role can remove a session.

curl -X DELETE -u <user>:<password> "http://<server>:<port>/<app>/mvc/session/<session_id>"

Remove all sessions

The request needs authentication. Only a user with the ROLE_ADMIN role can remove all sessions.

curl -X DELETE -u <user>:<password> "http://<server>:<port>/<app>/mvc/session/"