Knopflerfish OSGi 5.2.0

org.knopflerfish.service.um.useradmin
Interface PasswdSession


public interface PasswdSession

Interface for for a user name/password authentication session. First, a user name and a password should be supplied, then it is possible to authenticate the user or to get an Authorization object.

Version:
$Revision: 1.1.1.1 $
Author:
Gatespace AB

Method Summary
 User authenticate()
          Attempts to authenticate.
 ContextualAuthorization getAuthorization()
          Attempts to authenticate and authorize the user.
 void setPassword(java.lang.String password)
          Set the user's password.
 void setUsername(java.lang.String username)
          Set the user's user name.
 

Method Detail

setUsername

void setUsername(java.lang.String username)
Set the user's user name.

Parameters:
username - the username

setPassword

void setPassword(java.lang.String password)
Set the user's password.

Parameters:
password - the password

authenticate

User authenticate()
                  throws java.lang.IllegalStateException
Attempts to authenticate. Useful if authorization information is not required, see getAuthorization().

Returns:
the user, if a user admin service is available and there is a user with the supplied user name and the password matched. Otherwise null.
Throws:
java.lang.IllegalStateException - if called before a user name and a password have been supplied or if the user admin service is no longer available.

getAuthorization

ContextualAuthorization getAuthorization()
                                         throws java.lang.IllegalStateException
Attempts to authenticate and authorize the user.

Returns:
authorization information, or null if authentication failed.
Throws:
java.lang.IllegalStateException - if called before a user name and a password have been supplied or if the user admin service is no longer available.

Knopflerfish OSGi 5.2.0