public class Authenticator extends Listenable<AuthenticationListener,JsonObject>
AuthenticationListeners. The methods available in the AuthenticationListener
class allow developers to know whether or not the user was successfully authenticated.| Modifier and Type | Field and Description |
|---|---|
private String |
applicationIdentifier
Application Identifier for the application accessing the pathfinder server.
|
private String |
authenticationServerURL
URL of the server that is responsible for authenticating the users.
|
private static org.slf4j.Logger |
logger
Logs actions performed by the class.
|
private PathfinderServices |
services
Access to the web socket connection.
|
private String |
userCredential
String version of a JWT for the user's credentials.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Authenticator(String applicationIdentifier,
String userCredential,
String authenticationServerURL,
PathfinderServices services)
Creates an authenticator responsible for authenticating the user.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
authenticationFailed(String reason)
Tells the listeners that the authentication sequence failed.
|
protected boolean |
notifyUpdate(String reason,
JsonObject json)
Method called when an update occurs.
|
protected void |
sendToAuthenticationServer(String connectionId)
Sends a post request to the authentication server with the connection id
received from the pathfinder server to authenticate the user.
|
addListener, getListeners, removeListenerprivate static final org.slf4j.Logger logger
private final String applicationIdentifier
private final String userCredential
private final String authenticationServerURL
private final PathfinderServices services
protected Authenticator(String applicationIdentifier, String userCredential, String authenticationServerURL, PathfinderServices services)
applicationIdentifier - for the current application.userCredential - JWT as a String.authenticationServerURL - URL of the server that authenticates the user.services - a pathfinder services object.protected void sendToAuthenticationServer(String connectionId)
connectionId - received from the pathfinder server.private void authenticationFailed(String reason)
reason - of why the authentication sequence failed.protected boolean notifyUpdate(String reason, JsonObject json)
notifyUpdate in class Listenable<AuthenticationListener,JsonObject>reason - for notifying the model.json - object of the updated model.