Table of Contents

TSphinxWebLogin Class

Component to authenticate a TMS Web Core application to a Sphinx server.

Remarks

Use TSphinxWebLogin component to perform authentication and authorization to a Sphinx server from a TMS Web Core application. It abstracts the OAuth 2 authentication code with PKCE flow required by Sphinx, by discovering the authorization and token endpoints, performing the HTTP requests passing the proper parameters, processing the response provided to the redirect URLs and saving the identity and access tokens in to local web storage. Usage is simple, just properly set some key properties like Authority, ClientId and Scope and then use available methods like Login to effectively login to the server.

Syntax

Unit: Sphinx.WebLogin

TSphinxWebLogin = class(TComponent);

Methods

Name Description
AuthResult Provides information about the logged user.
IsLoggedIn Indicates if a user is logged in the application.
Login Starts the process to login to the web application.
Logout Logs out the user from the web application.
RefreshTokens Refreshes the stored tokens using the stored refresh token.

Properties

Name Description
Authority The base URL of the Sphinx server to authenticate to.
ClientId The client id used to identity the web application in the Sphinx server.
RedirectUri The redirect URI used to process the request sent by the server with the authorization code.
Scope The scope to be required to the Sphinx server.
SkipIssuerValidation Gets or sets whether issuer validation is skipped during ID token processing.

Events

Name Description
OnUserLoggedIn Event fired whenever a user is logged in.
OnValidateIssuer Event fired to allow custom validation of the issuer claim in the identity token.