org.apache.qpid.server.security.auth
Class PasswordFilePrincipalDatabase
java.lang.Object
org.apache.qpid.server.security.auth.PasswordFilePrincipalDatabase
- All Implemented Interfaces:
- PrincipalDatabase
public class PasswordFilePrincipalDatabase
- extends java.lang.Object
- implements PrincipalDatabase
Represents a user database where the account information is stored in a simple flat file.
The file is expected to be in the form:
username:password
username1:password1
...
usernamen:passwordn
where a carriage return separates each username/password pair. Passwords are assumed to be in
plain text.
Method Summary |
void |
setPassword(java.security.Principal principal,
javax.security.auth.callback.PasswordCallback callback)
Set the password for a given principal in the specified callback. |
void |
setPasswordFile(java.lang.String passwordFile)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PasswordFilePrincipalDatabase
public PasswordFilePrincipalDatabase()
setPasswordFile
public void setPasswordFile(java.lang.String passwordFile)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
setPassword
public void setPassword(java.security.Principal principal,
javax.security.auth.callback.PasswordCallback callback)
throws java.io.IOException,
javax.security.auth.login.AccountNotFoundException
- Description copied from interface:
PrincipalDatabase
- Set the password for a given principal in the specified callback. This is used for certain
SASL providers. The user database implementation should look up the password in any way it
chooses and set it in the callback by calling its setPassword method.
- Specified by:
setPassword
in interface PrincipalDatabase
- Parameters:
principal
- the principalcallback
- the password callback that wants to receive the password
- Throws:
java.io.IOException
- if there was an error looking up the principal
javax.security.auth.login.AccountNotFoundException
- if the account for specified principal could not be found