Class SimpleAuthenticationProvider
- java.lang.Object
-
- org.apache.guacamole.net.auth.AbstractAuthenticationProvider
-
- org.apache.guacamole.net.auth.simple.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 Summary
Constructors Constructor Description SimpleAuthenticationProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AuthenticatedUser
authenticateUser(Credentials credentials)
Returns an AuthenticatedUser representing the user authenticated by the given credentials, if any.abstract Map<String,org.apache.guacamole.protocol.GuacamoleConfiguration>
getAuthorizedConfigurations(Credentials credentials)
Given an arbitrary credentials object, returns a Map containing all configurations authorized by those credentials.UserContext
getUserContext(AuthenticatedUser authenticatedUser)
Returns the UserContext of the user authenticated by the given credentials.-
Methods inherited from class org.apache.guacamole.net.auth.AbstractAuthenticationProvider
decorate, getResource, redecorate, shutdown, updateAuthenticatedUser, updateUserContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.guacamole.net.auth.AuthenticationProvider
getIdentifier
-
-
-
-
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 returningnull
. Any authentication attempt will thus fall through to otherAuthenticationProvider
implementations, perhaps within other installed extensions, with thisAuthenticationProvider
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 interfaceAuthenticationProvider
- Overrides:
authenticateUser
in classAbstractAuthenticationProvider
- 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 otherAuthenticationProvider
implementations or provide data for authenticated users should override this function.- Specified by:
getUserContext
in interfaceAuthenticationProvider
- Overrides:
getUserContext
in classAbstractAuthenticationProvider
- 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.
-
-