Class LoginMethodImpl

    • Constructor Detail

      • LoginMethodImpl

        public LoginMethodImpl()
    • Method Detail

      • getIdentifier

        public String getIdentifier()
      • setIdentifier

        public void setIdentifier​(String identifier)
      • getType

        public LoginMethod.Type getType()
        Returns the type of the LoginMethod and defines which service will be used for connecting Gluon CloudLink users.
        Specified by:
        getType in interface LoginMethod
        Returns:
        the type of the LoginMethod.
      • setConfiguration

        public void setConfiguration​(Map<String,​String> configuration)
      • getProperty

        public Optional<String> getProperty​(String key)
        Description copied from interface: LoginMethod
        Return the value of a custom property of the LoginMethod. Returns Optional.empty() if no property exists with the given key.
        Specified by:
        getProperty in interface LoginMethod
        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

        public 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.
        Specified by:
        getConnectUrl in interface LoginMethod
        Returns:
        a string representing a URL to initiate the connect flow.
      • getCallbackUrl

        public 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.
        Specified by:
        getCallbackUrl in interface LoginMethod
        Returns:
        a string representing the callback URL that indicates the end of the connect flow.
      • getLoginUrl

        public RestClient getLoginUrl​(String username,
                                      String password)
        Returns the URL that must be used when verifying the login credentials of a user when authenticating with the LoginMethod.Type.PASSWORD or LoginMethod.Type.CUSTOM login method. The returned URL must be used in an HTTP POST request, providing the following form parameters:
        • username: the username of the user that was used when signing up
        • password: the password of the user
        The response is an object that contains an action, an optional user and an optional message. The action is a string containing one of the following values: CONNECT or FAILURE. The user is provided when the action equals CONNECT. Otherwise only the message is provided, explaining the reason of the failure in more detail.
        Specified by:
        getLoginUrl in interface LoginMethod
        Parameters:
        username - the username of the user that was used when signing up
        password - the password of the user
        Returns:
        the URL to use for verifying login credentials of a user
      • getSignUpUrl

        public RestClient getSignUpUrl​(String name,
                                       String username,
                                       String password)
        Returns the URL that must be used when signing up a new user that is authenticating with the LoginMethod.Type.PASSWORD login method. The returned URL must be used in an HTTP POST request, providing 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
        The username and password or both mandatory fields, as they are used to verify a user when logging in. The username must therefor also be unique across the application. The response of the HTTP request is an object that contains an action, an optional user and an optional message. The action is a string containing one of the following values: CONNECT or FAILURE. The user is provided when the action equals CONNECT. Otherwise only the message is provided, explaining the reason of the failure in more detail.
        Specified by:
        getSignUpUrl in interface LoginMethod
        Parameters:
        name - the full name of the user that is signing up
        username - the username of the user, used for future logins
        password - the password of the user
        Returns:
        the URL to use for signing up a new user