Package org.jivesoftware.openfire.auth
Interface AuthProvider
- All Known Implementing Classes:
AuthMultiProvider
,CrowdAuthProvider
,DefaultAuthProvider
,HybridAuthProvider
,JDBCAuthProvider
,LdapAuthProvider
,MappedAuthProvider
,NativeAuthProvider
,POP3AuthProvider
public interface AuthProvider
Provider interface for authentication. Users that wish to integrate with
their own authentication system must implement this class and then register
the implementation with Openfire in the
openfire.xml
file. An entry in that file would look like the following:
<provider> <auth> <className>com.foo.auth.CustomAuthProvider</className> </auth> </provider>
- Author:
- Matt Tucker
-
Method Summary
Modifier and TypeMethodDescriptionvoid
authenticate
(String username, String password) Returns if the username and password are valid; otherwise this method throws an UnauthorizedException.int
getIterations
(String username) getPassword
(String username) Returns the user's password.getServerKey
(String username) getStoredKey
(String username) boolean
void
setPassword
(String username, String password) Sets the user's password.boolean
Returns true if this UserProvider is able to retrieve user passwords from the backend user store.
-
Method Details
-
authenticate
void authenticate(String username, String password) throws UnauthorizedException, ConnectionException, InternalUnauthenticatedException Returns if the username and password are valid; otherwise this method throws an UnauthorizedException.- Parameters:
username
- the username or full JID.password
- the password- Throws:
UnauthorizedException
- if the username and password do not match any existing user.ConnectionException
- it there is a problem connecting to user and group systemInternalUnauthenticatedException
- if there is a problem authentication Openfire itself into the user and group system
-
getPassword
Returns the user's password. This method should throw an UnsupportedOperationException if this operation is not supported by the backend user store.- Parameters:
username
- the username of the user.- Returns:
- the user's password.
- Throws:
UserNotFoundException
- if the given user's password could not be loaded.UnsupportedOperationException
- if the provider does not support the operation (this is an optional operation).
-
setPassword
void setPassword(String username, String password) throws UserNotFoundException, UnsupportedOperationException Sets the user's password. This method should throw an UnsupportedOperationException if this operation is not supported by the backend user store.- Parameters:
username
- the username of the user.password
- the new plaintext password for the user.- Throws:
UserNotFoundException
- if the given user could not be loaded.UnsupportedOperationException
- if the provider does not support the operation (this is an optional operation).
-
supportsPasswordRetrieval
boolean supportsPasswordRetrieval()Returns true if this UserProvider is able to retrieve user passwords from the backend user store. If this operation is not supported thengetPassword(String)
will throw anUnsupportedOperationException
if invoked.- Returns:
- true if this UserProvider is able to retrieve user passwords from the backend user store.
-
isScramSupported
boolean isScramSupported() -
getSalt
-
getIterations
-
getServerKey
-
getStoredKey
-