|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.guacamole.net.basic.auth.Authorization
public class Authorization
Mapping of username/password pair to configuration set. In addition to basic storage of the username, password, and configurations, this class also provides password validation functions.
Nested Class Summary | |
---|---|
static class |
Authorization.Encoding
All supported password encodings. |
Constructor Summary | |
---|---|
Authorization()
|
Method Summary | |
---|---|
void |
addConfiguration(String name,
net.sourceforge.guacamole.protocol.GuacamoleConfiguration config)
Adds the given GuacamoleConfiguration to the set of stored configurations under the given name. |
net.sourceforge.guacamole.protocol.GuacamoleConfiguration |
getConfiguration(String name)
Returns the GuacamoleConfiguration having the given name and associated with the username/password pair stored within this authorization. |
Map<String,net.sourceforge.guacamole.protocol.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Authorization()
Method Detail |
---|
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 net.sourceforge.guacamole.protocol.GuacamoleConfiguration getConfiguration(String name)
name
- The name of the GuacamoleConfiguration to return.
public void addConfiguration(String name, net.sourceforge.guacamole.protocol.GuacamoleConfiguration config)
name
- The name to associate this GuacamoleConfiguration with.config
- The GuacamoleConfiguration to store.public Map<String,net.sourceforge.guacamole.protocol.GuacamoleConfiguration> getConfigurations()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |