public class Authorization extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Authorization.Encoding
All supported password encodings.
|
Constructor and Description |
---|
Authorization() |
Modifier and Type | Method and Description |
---|---|
void |
addConfiguration(String name,
GuacamoleConfiguration config)
Adds the given GuacamoleConfiguration to the set of stored configurations
under the given name.
|
GuacamoleConfiguration |
getConfiguration(String name)
Returns the GuacamoleConfiguration having the given name and associated
with the username/password pair stored within this authorization.
|
Map<String,GuacamoleConfiguration> |
getConfigurations()
Returns a Map of all stored GuacamoleConfigurations associated with the
username/password pair stored within this authorization, indexed by
configuration name.
|
Authorization.Encoding |
getEncoding()
Returns the encoding used to hash the password, if any.
|
String |
getPassword()
Returns the password associated with this authorization, which may be
encoded or hashed.
|
String |
getUsername()
Returns the username associated with this authorization.
|
void |
setEncoding(Authorization.Encoding encoding)
Sets the encoding which will be used to hash the password or when
comparing a given password for validation.
|
void |
setPassword(String password)
Sets the password associated with this authorization, which must be
encoded using the encoding specified with setEncoding().
|
void |
setUsername(String username)
Sets the username associated with this authorization.
|
boolean |
validate(String username,
String password)
Returns whether a given username/password pair is authorized based on
the stored username and password.
|
public String getUsername()
public void setUsername(String username)
username
- The username to associate with this authorization.public String getPassword()
public void setPassword(String password)
password
- Sets the password associated with this authorization.public Authorization.Encoding getEncoding()
public void setEncoding(Authorization.Encoding encoding)
encoding
- The encoding to use for password hashing.public boolean validate(String username, String password)
username
- The username to validate.password
- The password to validate.public GuacamoleConfiguration getConfiguration(String name)
name
- The name of the GuacamoleConfiguration to return.public void addConfiguration(String name, GuacamoleConfiguration config)
name
- The name to associate this GuacamoleConfiguration with.config
- The GuacamoleConfiguration to store.public Map<String,GuacamoleConfiguration> getConfigurations()
Copyright © 2014. All Rights Reserved.