Session Management
Session Management Examples
Below are examples of ways to use session management.
1. Validate Session Token
To validate a session token and retrieve session details, use the following API request:
Parameters:
- sessionToken: The session token received from OTPless after authentication.
- clientId: Your unique client ID from OTPless.
- clientSecret: Your client secret key from OTPless.
Response:
If the session token is valid, the API will return session details, including the user’s identity and session status.
2. Log Out a User
To log out a user and revoke their session, use the following API request:
Parameters:
- sessionToken: The session token associated with the user session you want to revoke.
- clientId: Your unique client ID from OTPless.
- clientSecret: Your client secret key from OTPless.
Response:
Upon successful revocation, the session will be invalidated, and the user will be logged out from the system.
Notes:
- Ensure you store your
clientId
andclientSecret
securely and do not expose them in client-side code. - Always use HTTPS to secure communication with OTPless servers.
- For best practices, follow the OWASP guidelines for session management and token storage.
Was this page helpful?