-
- All Known Implementing Classes:
LoginMethodImpl
public interface LoginMethod
A LoginMethod is used to specify which method should be used for connecting users to your application. Connecting a user to Gluon CloudLink is initiated by calling theconnect URL
, for instance in a WebView. The URL will start the connect process on Gluon CloudLink and might redirect the browser to another website, e.g. Facebook. When the connect flow has finished, the browser will finally be redirected to thecallback URL
. The response from this URL contains information about the connected user as a JSON object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
LoginMethod.Type
Defines the different methods by which you can log in to Gluon CloudLink.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getCallbackUrl()
Constructs the URL that identifies the callback URL that will be called on Gluon CloudLink as the final step in the connect flow.String
getConnectUrl()
Constructs the URL that needs to be called to initiate the connect flow for this login method on Gluon CloudLink.RestClient
getLoginUrl(String username, String password)
Returns a configured instance of a RestClient that must be used when verifying the login credentials of a user when authenticating with theLoginMethod.Type.PASSWORD
login method.Optional<String>
getProperty(String key)
Return the value of a custom property of the LoginMethod.RestClient
getSignUpUrl(String name, String username, String password)
Returns a configured instance of a RestClient that must be used when signing up a new user that is authenticating with theLoginMethod.Type.PASSWORD
login method.LoginMethod.Type
getType()
Returns the type of the LoginMethod and defines which service will be used for connecting Gluon CloudLink users.
-
-
-
Method Detail
-
getType
LoginMethod.Type getType()
Returns the type of the LoginMethod and defines which service will be used for connecting Gluon CloudLink users.- Returns:
- the type of the LoginMethod.
-
getProperty
Optional<String> getProperty(String key)
Return the value of a custom property of the LoginMethod. Returns Optional.empty() if no property exists with the given key.- Parameters:
key
- the key of the property to look up- Returns:
- an Optional string containing the value of the property that matches the given key
-
getConnectUrl
String getConnectUrl()
Constructs the URL that needs to be called to initiate the connect flow for this login method on Gluon CloudLink. The URL can be loaded into a WebView to start the flow.- Returns:
- a string representing a URL to initiate the connect flow.
-
getCallbackUrl
String getCallbackUrl()
Constructs the URL that identifies the callback URL that will be called on Gluon CloudLink as the final step in the connect flow. When the location property of a WebView's WebEngine starts with the callback URL, you know that the connect flow has finished.- Returns:
- a string representing the callback URL that indicates the end of the connect flow.
-
getLoginUrl
RestClient getLoginUrl(String username, String password)
Returns a configured instance of a RestClient that must be used when verifying the login credentials of a user when authenticating with theLoginMethod.Type.PASSWORD
login method. The RestClient is configured as an HTTP POST request with the following form parameters:- username: the username of the user that was used when signing up
- password: the password of the user
- Parameters:
username
- the username of the user that was used when signing uppassword
- the password of the user- Returns:
- the RestClient to use for verifying login credentials of a user
-
getSignUpUrl
RestClient getSignUpUrl(String name, String username, String password)
Returns a configured instance of a RestClient that must be used when signing up a new user that is authenticating with theLoginMethod.Type.PASSWORD
login method. The RestClient is configured as an HTTP POST request with the following form parameters:- name: the full name of the user that is signing up (optional)
- username: the username of the user
- password: the password of the user
- Parameters:
name
- the full name of the user that is signing upusername
- the username of the user, used for future loginspassword
- the password of the user- Returns:
- the RestClient to use for signing up a new user
-
-