public interface AuthRepository extends Repository
AuthRepository
defines a proxy bridge between user authentication data storage and the Tigase
server authentication logic. Important thing about the authentication repository is that it not only stores login
credentials but also performs actual user authentication. This is because available authentication mechanisms depend
on the way data are stored in the repository (database).
Modifier and Type | Interface and Description |
---|---|
static class |
AuthRepository.AccountStatus |
static class |
AuthRepository.DefaultCredentials |
static class |
AuthRepository.SingleCredential |
Repository.Meta, Repository.SchemaId
Modifier and Type | Field and Description |
---|---|
static String |
DATA_KEY
Property key name for
otherAuth method call. |
static String |
DIGEST_ID_KEY |
static String |
DIGEST_KEY |
static String |
MACHANISM_KEY
Property key name for
otherAuth method call. |
static String |
PASSWORD_KEY |
static String |
PROTOCOL_KEY
Property key name for
otherAuth method call. |
static String |
PROTOCOL_VAL_NONSASL
Property value for
otherAuth method call. |
static String |
PROTOCOL_VAL_SASL
Property value for
otherAuth method call. |
static String |
REALM_KEY
Property key name for
otherAuth method call. |
static String |
RESULT_KEY
Property key name for
otherAuth method call. |
static String |
SERVER_NAME_KEY
Property key name for
otherAuth method call. |
static String |
USER_ID_KEY
Property key name for
otherAuth method call. |
static String |
USERNAME_KEY |
Modifier and Type | Method and Description |
---|---|
void |
addUser(BareJID user,
String password) |
AuthRepository.AccountStatus |
getAccountStatus(BareJID user) |
default Credentials |
getCredentials(BareJID user,
String username) |
String |
getPassword(BareJID user)
Deprecated.
|
String |
getResourceUri()
getResourceUri method returns database connection string. |
default Collection<String> |
getUsernames(BareJID user) |
long |
getUsersCount()
This method is only used by the server statistics component to report number of registered users.
|
long |
getUsersCount(String domain)
This method is only used by the server statistics component to report number of registered users for given
domain.
|
default boolean |
isMechanismSupported(String domain,
String mechanism) |
default boolean |
isUserDisabled(BareJID user)
Deprecated.
|
void |
loggedIn(BareJID jid)
Do some actions on repository, when user logs in.
|
void |
logout(BareJID user) |
boolean |
otherAuth(Map<String,Object> authProps)
Deprecated.
|
void |
queryAuth(Map<String,Object> authProps)
Deprecated.
|
default void |
removeCredential(BareJID user,
String username) |
void |
removeUser(BareJID user) |
void |
setAccountStatus(BareJID user,
AuthRepository.AccountStatus status) |
default void |
setCredentialsCodecs(CredentialsEncoderBean encoder,
CredentialsDecoderBean decoder) |
default void |
setUserDisabled(BareJID user,
Boolean value)
Deprecated.
|
default void |
updateCredential(BareJID user,
String username,
String password) |
void |
updatePassword(BareJID user,
String password)
Deprecated.
|
initRepository
static final String DATA_KEY
otherAuth
method call. It is used to provide an extra authentication data by
the client to the authentication logic. Please note the RESULT_KEY
property key is used to provide
authentication data from the server to the client. This property is used to provide authentication data from the
client to the server.static final String DIGEST_ID_KEY
static final String DIGEST_KEY
static final String MACHANISM_KEY
otherAuth
method call. It is used to provide desired authentication mechanism
to the authentication logic.static final String PASSWORD_KEY
static final String PROTOCOL_KEY
otherAuth
method call. It is used to provide desired authentication protocol
to the authentication logic.static final String PROTOCOL_VAL_NONSASL
otherAuth
method call. It is used to provide desired authentication NON-SASL
protocol to the authentication logic.static final String PROTOCOL_VAL_SASL
otherAuth
method call. It is used to provide desired authentication SASL protocol
to the authentication logic.static final String REALM_KEY
otherAuth
method call. It is used to provide authentication realm to the
authentication logic. In most cases, the realm is just a domain name.static final String RESULT_KEY
otherAuth
method call. It is used to provide authentication handshaking data
during login process. Some authentication mechanisms require exchanging requests between the client and the
server. This property key points back to the data which need to be sent back to the client.static final String SERVER_NAME_KEY
otherAuth
method call. It is used to provide authentication domain to the
authentication logic. It is highly recommended that this property is always set, even if the authentication
protocol/mechanism does not need it strictly.static final String USER_ID_KEY
otherAuth
method call. It is used to provide a user ID on successful user
login. Please note, the key points to the object of BareJID
type.static final String USERNAME_KEY
void addUser(BareJID user, String password) throws TigaseDBException
TigaseDBException
AuthRepository.AccountStatus getAccountStatus(BareJID user) throws TigaseDBException
TigaseDBException
default Credentials getCredentials(BareJID user, String username) throws TigaseDBException
TigaseDBException
@Deprecated String getPassword(BareJID user) throws TigaseDBException
TigaseDBException
String getResourceUri()
getResourceUri
method returns database connection string.String
value of database connection string.default Collection<String> getUsernames(BareJID user) throws TigaseDBException
TigaseDBException
long getUsersCount()
long
number of registered users in the repository.long getUsersCount(String domain)
domain
- for which get the statisticslong
number of registered users in the repository.@Deprecated default boolean isUserDisabled(BareJID user) throws TigaseDBException
TigaseDBException
void loggedIn(BareJID jid) throws TigaseDBException
last_login_time
)jid
- JID of logged user.TigaseDBException
- if an error occursvoid logout(BareJID user) throws TigaseDBException
TigaseDBException
@Deprecated boolean otherAuth(Map<String,Object> authProps) throws TigaseDBException, AuthorizationException
@Deprecated void queryAuth(Map<String,Object> authProps)
queryAuth
returns mechanisms available for authentication.authProps
- a Map
value with parameters for authentication.default void removeCredential(BareJID user, String username) throws TigaseDBException
TigaseDBException
void removeUser(BareJID user) throws TigaseDBException
TigaseDBException
void setAccountStatus(BareJID user, AuthRepository.AccountStatus status) throws TigaseDBException
TigaseDBException
default void setCredentialsCodecs(CredentialsEncoderBean encoder, CredentialsDecoderBean decoder)
@Deprecated default void setUserDisabled(BareJID user, Boolean value) throws TigaseDBException
TigaseDBException
default void updateCredential(BareJID user, String username, String password) throws TigaseDBException
TigaseDBException
@Deprecated void updatePassword(BareJID user, String password) throws TigaseDBException
TigaseDBException
Copyright © 2004–2019 "Tigase, Inc.". All rights reserved.