ORTs are prefixed with ORT to distinguish them from refresh tokens. However, you should treat the token as opaque and not rely on its internal structure.
When you revoke an ORT, it terminates the entire Auth0 session, not just the token. This invalidates all ORTs bound to that session and ends SSO for the user.
Use the event.refresh_token object to determine if the token is an ORT.
Access session specific data using the event.session object to make decisions based on the current session state
exports.onExecutePostLogin = async (event, api) => { // Check if token is an Online refresh token if (event.refresh_token?.access == 'online') { // The token is an ORT, you can then reference event.session and api.session console.log('Exchanging Online Refresh Token bound to Session ID: ', event.session?.id); // Pull the session metadata and add it in the tokens // Assuming the session metadata was stored previously const importantInformation = event.session?.metadata?.importantInformation; api.accessToken.setCustomClaim('info', importantInformation); api.idToken.setCustomClaim('info', importantInformation); }};
Auth0 revokes the entire user session rather than just the token, when the api.refreshToken.revoke() method is used with an ORT.