Table of Contents

TSphinxLogin Class

Component to authenticate a native application to a Sphinx server.

Remarks

Use TSphinxLogin component to perform authentication and authorization to a Sphinx server from a native 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 memory. 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.Login

TSphinxLogin = 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 application.
Logout Logs out the user from the application.
RefreshTokens Refreshes the stored tokens using the stored refresh token.
RequestToken Retrieves access token using client credentials flow.

Properties

Name Description
Authority The base URL of the Sphinx server to authenticate to.
ClientId The client id used to identity the native application in the Sphinx server.
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
OnGetBrowser Fires before the browser is launched to show the login page.
OnUserLoggedIn Event fired whenever a user is logged in.
OnValidateIssuer Event fired to allow custom validation of the issuer claim in the identity token.