Class SimpleAuthenticationProvider

  • All Implemented Interfaces:
    AuthenticationProvider

    public abstract class SimpleAuthenticationProvider
    extends AbstractAuthenticationProvider
    Provides means of retrieving a set of named GuacamoleConfigurations for a given Credentials object. This is a simple AuthenticationProvider implementation intended to be easily extended. It is useful for simple authentication situations where access to web-based administration and complex users and permissions are not required. The interface provided by SimpleAuthenticationProvider is similar to that of the AuthenticationProvider interface of older Guacamole releases.
    • Constructor Detail

      • SimpleAuthenticationProvider

        public SimpleAuthenticationProvider()
    • Method Detail

      • getAuthorizedConfigurations

        public abstract Map<String,​org.apache.guacamole.protocol.GuacamoleConfiguration> getAuthorizedConfigurations​(Credentials credentials)
                                                                                                                    throws org.apache.guacamole.GuacamoleException
        Given an arbitrary credentials object, returns a Map containing all configurations authorized by those credentials. The keys of this Map are Strings which uniquely identify each configuration.
        Parameters:
        credentials - The credentials to use to retrieve authorized configurations.
        Returns:
        A Map of all configurations authorized by the given credentials, or null if the credentials given are not authorized.
        Throws:
        org.apache.guacamole.GuacamoleException - If an error occurs while retrieving configurations.
      • authenticateUser

        public AuthenticatedUser authenticateUser​(Credentials credentials)
                                           throws org.apache.guacamole.GuacamoleException
        Description copied from class: AbstractAuthenticationProvider
        Returns an AuthenticatedUser representing the user authenticated by the given credentials, if any.

        This implementation performs no authentication whatsoever, ignoring the provided credentials and simply returning null. Any authentication attempt will thus fall through to other AuthenticationProvider implementations, perhaps within other installed extensions, with this AuthenticationProvider making no claim regarding the user's identity nor whether the user should be allowed or disallowed from accessing Guacamole. Implementations that wish to authenticate users should override this function.

        Specified by:
        authenticateUser in interface AuthenticationProvider
        Overrides:
        authenticateUser in class AbstractAuthenticationProvider
        Parameters:
        credentials - The credentials to use for authentication.
        Returns:
        An AuthenticatedUser representing the user authenticated by the given credentials, if any, or null if the credentials are invalid.
        Throws:
        org.apache.guacamole.GuacamoleException - If an error occurs while authenticating the user, or if access is temporarily, permanently, or conditionally denied, such as if the supplied credentials are insufficient or invalid.
      • getUserContext

        public UserContext getUserContext​(AuthenticatedUser authenticatedUser)
                                   throws org.apache.guacamole.GuacamoleException
        Description copied from class: AbstractAuthenticationProvider
        Returns the UserContext of the user authenticated by the given credentials.

        This implementation simply returns null, effectively allowing authentication to continue but refusing to provide data for the given user. Implementations that wish to veto the authentication results of other AuthenticationProvider implementations or provide data for authenticated users should override this function.

        Specified by:
        getUserContext in interface AuthenticationProvider
        Overrides:
        getUserContext in class AbstractAuthenticationProvider
        Parameters:
        authenticatedUser - An AuthenticatedUser object representing the user authenticated by an arbitrary set of credentials. The AuthenticatedUser may come from this AuthenticationProvider or any other installed AuthenticationProvider.
        Returns:
        A UserContext describing the permissions, connection, connection groups, etc. accessible or associated with the given authenticated user, or null if this AuthenticationProvider refuses to provide any such data.
        Throws:
        org.apache.guacamole.GuacamoleException - If an error occurs while creating the UserContext.