Unit
ScRestAuthenticator
Description
TScRestBearerAuthenticator is a class that implements Bearer authentication for each request made through the associated TScRestClient.
Unlike basic authenticators, this class overrides the Execute method to independently perform a login procedure to a specified REST service endpoint. It receives a JSON response containing a Bearer token, stores it, and adds an Authorization header with the value "Bearer " + AccessToken to each request.
If a valid token is already loaded and hasn't expired, the Execute method skips the login process. This allows the token to be obtained once—typically during the first request—and reused until it expires.
Developers can also preload the token and other properties into the TScRestBearerAuthenticator object, enabling token reuse across sessions.