tigase.db
Interface AuthRepository

All Known Implementing Classes:
AuthRepositoryImpl, AuthRepositoryMDImpl, AuthRepositoryPool, DrupalWPAuth, DummyRepository, JDBCRepository, LdapAuthProvider, TigaseAuth, TigaseCustomAuth, XMLRepository

public interface AuthRepository

Interface 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). Created: Sun Nov 5 21:15:46 2006

Version:
$Rev$
Author:
Artur Hefczyc

Field Summary
static String DATA_KEY
          Property key name for otherAuth method call.
static String DIGEST_ID_KEY
          Field description
static String DIGEST_KEY
          Field description
static String MACHANISM_KEY
          Property key name for otherAuth method call.
static String PASSWORD_KEY
          Field description
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
          Field description
 
Method Summary
 void addUser(tigase.xmpp.BareJID user, String password)
          Describe addUser method here.
 boolean digestAuth(tigase.xmpp.BareJID user, String digest, String id, String alg)
          Deprecated. 
 String getResourceUri()
          getResourceUri method returns database connection string.
 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.
 void initRepository(String resource_uri, Map<String,String> params)
          initRepository method is doing initialization for database connection.
 void logout(tigase.xmpp.BareJID user)
          Describe logout method here.
 boolean otherAuth(Map<String,Object> authProps)
          Describe otherAuth method here.
 boolean plainAuth(tigase.xmpp.BareJID user, String password)
          Deprecated. use method otherAuth(Map) because this method is preferred. In a long term plans all authentication methods should use otherAuth(...) calls.
 void queryAuth(Map<String,Object> authProps)
          queryAuth returns mechanisms available for authentication.
 void removeUser(tigase.xmpp.BareJID user)
          Describe removeUser method here.
 void updatePassword(tigase.xmpp.BareJID user, String password)
          Describe updatePassword method here.
 

Field Detail

DATA_KEY

static final String DATA_KEY
Property key name for 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.

See Also:
Constant Field Values

DIGEST_ID_KEY

static final String DIGEST_ID_KEY
Field description

See Also:
Constant Field Values

DIGEST_KEY

static final String DIGEST_KEY
Field description

See Also:
Constant Field Values

MACHANISM_KEY

static final String MACHANISM_KEY
Property key name for otherAuth method call. It is used to provide desired authentication mechanism to the authentication logic.

See Also:
Constant Field Values

PASSWORD_KEY

static final String PASSWORD_KEY
Field description

See Also:
Constant Field Values

PROTOCOL_KEY

static final String PROTOCOL_KEY
Property key name for otherAuth method call. It is used to provide desired authentication protocol to the authentication logic.

See Also:
Constant Field Values

PROTOCOL_VAL_NONSASL

static final String PROTOCOL_VAL_NONSASL
Property value for otherAuth method call. It is used to provide desired authentication NON-SASL protocol to the authentication logic.

See Also:
Constant Field Values

PROTOCOL_VAL_SASL

static final String PROTOCOL_VAL_SASL
Property value for otherAuth method call. It is used to provide desired authentication SASL protocol to the authentication logic.

See Also:
Constant Field Values

REALM_KEY

static final String REALM_KEY
Property key name for otherAuth method call. It is used to provide authentication realm to the authentication logic. In most cases, the realm is just a domain name.

See Also:
Constant Field Values

RESULT_KEY

static final String RESULT_KEY
Property key name for 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.

See Also:
Constant Field Values

SERVER_NAME_KEY

static final String SERVER_NAME_KEY
Property key name for 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.

See Also:
Constant Field Values

USER_ID_KEY

static final String USER_ID_KEY
Property key name for 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.

See Also:
Constant Field Values

USERNAME_KEY

static final String USERNAME_KEY
Field description

See Also:
Constant Field Values
Method Detail

addUser

void addUser(tigase.xmpp.BareJID user,
             String password)
             throws UserExistsException,
                    TigaseDBException
Describe addUser method here.

Parameters:
user - a BareJID value
password - a String value
Throws:
UserExistsException - if an error occurs
TigaseDBException - if an error occurs

digestAuth

@Deprecated
boolean digestAuth(tigase.xmpp.BareJID user,
                              String digest,
                              String id,
                              String alg)
                   throws UserNotFoundException,
                          TigaseDBException,
                          AuthorizationException
Deprecated. 

digestAuth method performs non-sasl, digest authentication as described in non-sasl authentication XEP-0078 For now it is empty and always returns false as I don't have description for database with passwords.

Parameters:
user - a BareJID value of user name
digest - a String value password digest sum
id - a String value session ID used for digest sum calculation.
alg - a String value of algorithm ID used for digest sum calculation.
Returns:
a boolean value true on successful authentication, false on authentication failure.
Throws:
UserNotFoundException - if an given user name is not found in the authentication repository.
TigaseDBException - if an error occurs during during accessing database;
AuthorizationException - if an error occurs during authentication process.

getResourceUri

String getResourceUri()
getResourceUri method returns database connection string.

Returns:
a String value of database connection string.

getUsersCount

long getUsersCount()
This method is only used by the server statistics component to report number of registered users.

Returns:
a long number of registered users in the repository.

getUsersCount

long getUsersCount(String domain)
This method is only used by the server statistics component to report number of registered users for given domain.

Parameters:
domain -
Returns:
a long number of registered users in the repository.

initRepository

void initRepository(String resource_uri,
                    Map<String,String> params)
                    throws DBInitException
initRepository method is doing initialization for database connection. It may also do lazy initialization with database. Connection to database might be established during the first authentication request.

Parameters:
resource_uri - a String value of database connection string. The string must also contain database user name and password if required for connection.
params -
Throws:
DBInitException - if an error occurs during access database. It won't happen however as in this method we do simple variable assigment.

logout

void logout(tigase.xmpp.BareJID user)
            throws UserNotFoundException,
                   TigaseDBException
Describe logout method here.

Parameters:
user - a BareJID value
Throws:
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs

otherAuth

boolean otherAuth(Map<String,Object> authProps)
                  throws UserNotFoundException,
                         TigaseDBException,
                         AuthorizationException
Describe otherAuth method here.

Parameters:
authProps - a Map value
Returns:
a boolean value
Throws:
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs
AuthorizationException - if an error occurs

plainAuth

@Deprecated
boolean plainAuth(tigase.xmpp.BareJID user,
                             String password)
                  throws UserNotFoundException,
                         TigaseDBException,
                         AuthorizationException
Deprecated. use method otherAuth(Map) because this method is preferred. In a long term plans all authentication methods should use otherAuth(...) calls.

plainAuth method performs non-sasl, plain authentication as described in non-sasl authentication XEP-0078.

Parameters:
user - a BareJID value of user name
password - a String value of plain user password.
Returns:
a boolean value true on successful authentication, false on authentication failure.
Throws:
UserNotFoundException - if an given user name is not found in the authentication repository.
TigaseDBException - if an error occurs during during accessing database;
AuthorizationException - if an error occurs during authentication process.

queryAuth

void queryAuth(Map<String,Object> authProps)
queryAuth returns mechanisms available for authentication.

Parameters:
authProps - a Map value with parameters for authentication.

removeUser

void removeUser(tigase.xmpp.BareJID user)
                throws UserNotFoundException,
                       TigaseDBException
Describe removeUser method here.

Parameters:
user - a BareJID value
Throws:
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs

updatePassword

void updatePassword(tigase.xmpp.BareJID user,
                    String password)
                    throws UserNotFoundException,
                           TigaseDBException
Describe updatePassword method here.

Parameters:
user - a BareJID value
password - a String value
Throws:
UserNotFoundException
TigaseDBException - if an error occurs


Copyright © 2013 Tigase. All rights reserved.