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
Login Starts the process to login to the application.
Logout Logs out the user from the web application.
IsLoggedIn Indicates if a user is logged in the application.
AuthResult Provides information about the logged user.

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.
Scope The scope to be required to the Sphinx server.
RedirectUri The redirect URI used to process the request sent by the server with the authorization code.

Events

Name Description
OnUserLoggedIn Event fired whenever a user is logged in.