org.androidpn.server.xmpp.auth
Class AuthManager

java.lang.Object
  extended by org.androidpn.server.xmpp.auth.AuthManager

public class AuthManager
extends java.lang.Object

This class is to provide the methods associated with user authentication.

Author:
Sehwan Noh (devnoh@gmail.com)

Constructor Summary
AuthManager()
           
 
Method Summary
static AuthToken authenticate(java.lang.String username, java.lang.String password)
          Authenticates a user with a username and plain text password, and returns an AuthToken.
static AuthToken authenticate(java.lang.String username, java.lang.String token, java.lang.String digest)
          Authenticates a user with a username, token, and digest, and returns an AuthToken.
static boolean isDigestSupported()
          Returns true if digest authentication is supported according to JEP-0078.
static boolean isPlainSupported()
          Returns true if plain text password authentication is supported according to JEP-0078.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthManager

public AuthManager()
Method Detail

authenticate

public static AuthToken authenticate(java.lang.String username,
                                     java.lang.String password)
                              throws UnauthenticatedException
Authenticates a user with a username and plain text password, and returns an AuthToken.

Parameters:
username - the username
password - the password
Returns:
an AuthToken
Throws:
UnauthenticatedException - if the username and password do not match

authenticate

public static AuthToken authenticate(java.lang.String username,
                                     java.lang.String token,
                                     java.lang.String digest)
                              throws UnauthenticatedException
Authenticates a user with a username, token, and digest, and returns an AuthToken.

Parameters:
username - the username
token - the token
digest - the digest
Returns:
an AuthToken
Throws:
UnauthenticatedException - if the username and password do not match

isPlainSupported

public static boolean isPlainSupported()
Returns true if plain text password authentication is supported according to JEP-0078.

Returns:
true if plain text password authentication is supported

isDigestSupported

public static boolean isDigestSupported()
Returns true if digest authentication is supported according to JEP-0078.

Returns:
true if digest authentication is supported