Enables you to implement a mechanism to log the user into the Pega Platform.
An instance of the PegaAuthenticator
object is created by calling the
authenticator
method.
PegaAuthenticator can operate in one of the following two modes, based on the value of the
Pega-AppDefinition/authentication_type
dynamic system setting. The
dynamic system setting can take the following values:
The authentication mechanism attempts to authenticate the user by sending login credentials to the Pega Platform instance.
The authentication mechanism attempts to authenticate the user by sending login
credentials to the OAuth2 server, whose address is defined in the
Pega-AppDefinition/OAuth2/token_endpoint
dynamic system setting.
If the credentials are recognized, the OAuth2 server returns an access token that is
used as a loginActivity
token to login to the Pega Platform
server.
All relevant dynamic system settings are set in the Pega Platform and passed to the Pega Mobile Client at application building phase. For details, see Configuring user authentication with Oauth2 tokens.
Name | Description | Type | Use |
---|---|---|---|
loginActivity | The LoginActivityType enum that defines a login activity used for the selected Pega Platform instance. | object |
optional |
url | A URL address of the Pega Platform instance that you want to log the user into. You must set a URL for each authenticator instance. Once set, all three methods (logIn, logOff, isLoggedIn) will use the same URL and optionally loginActivity. If you are using the oauth2 mode, you must provide the URL which points to the custom servlet bound to the PRPC Authentication Service which uses OAuth token validation. In the oauth2 scenario, the URL value is taken from the Use alternative server URL field. | string |
required |
Name | Description |
---|---|
logIn | Attempts to authenticate the user. |
logOff | Logs the user out of the Pega Platform instance and calls the |
isLoggedIn | Verifies if the user is logged in to the Pega Platform instance (in the basic mode) or if the access token is still valid (in oauth2 mode). |