public interface AuthenticationView
An AuthenticationView is an interface that defines how a user can connect with Gluon CloudLink, by using one of the available login methods that are defined in the application. Implementations will usually show up a list of buttons that each represent one of these login methods. When a login method is clicked, it could show a web page that starts the connect flow by loading the login method's connect URL.
The UserClient
will try to create an AuthenticationView instance by
loading the class that is defined in the system property
com.gluonhq.cloudlink.client.user.AuthenticationView
. If the system
property is not defined, it will try to load the default Gluon Mobile implementation,
which is based on Glisten.
Modifier and Type | Method and Description |
---|---|
void |
addLoginMethod(LoginMethod loginMethod)
DataClient will initially retrieve the login methods that are defined by a
Gluon application from Gluon CloudLink.
|
void |
authenticate(java.util.function.Consumer<java.lang.String> contentConsumer)
This method is called every time a request to Gluon CloudLink is made that
requires an authenticated user and no authenticated user is currently
active in the application.
|
void addLoginMethod(LoginMethod loginMethod)
loginMethod
- a new login method that is available for this
application.void authenticate(java.util.function.Consumer<java.lang.String> contentConsumer)
contentConsumer
will be called with
a JSON string that represents the connected user. When the user cancels
the view, you can pass in a null
value to the consumer,
which will notify the DataClient that the authentication process was aborted
by the user.contentConsumer
- a Consumer that is called when authentication
finished.