This class allows you to interact with a user's session in the current browser
global cym.Browser.SessionVerifications verifications;
The Id of the user who can login with this session
The Id of this session
global Id lastLoginHistoryId;
The last LoginHistory
which was used with this session
global Boolean isActive();
A boolean indicating if the session has been activated.
global cym.Remote.Apex getRemoteApex(Type fn);
fn
: A
Type
which extends the
cym.Remote.Apex. The Apex Function will run under the session's
OwnerId
; even if the user is not currently logged in.
This is a very powerful feature which mimics System.runAs
but is not limited to testing. Use it with caution.
global Session activate();
global Session activate(String requestId);
Fetches the required sid to start a session.
This method is mainly used from an guest context for passwordless login.
requestId
: A unique identifier of the authentication request. It's stored as part of the verification process and allows you to correlate multiple verifications belonging to the same request.
If you don't provide an identifier, a random value is generated.
The current Session
global PageReference resume(String startURL);
Use this method to establish the user session in the user's browser and redirect her to a specific page
startURL
: The relative URL where the user should be redirected after the session has been established
PageReference where the user can be redirected
This is a very powerful feature which allows you to start a user session anytime. Always require a user verification (password, biometrics, ...) before calling it.
Use this method to synchronize the Salesforce Authenticators (password, TOTP, ...) with the current Session.
The current Session
global Session apply(cym.Community.Authenticator authenticator, Integer maxAge, String[] amrs);
Use this method to add a new nerification to the current session. You must ensure that the verification has been successfully completed by the user before using this method
authenticator
: A reference to the authenticator which was used during the user verification
maxAge
: An integer which overrides the default authenticator maxAge
amrs
: A list of amrs which override the default authenticator amrs
The current Session