Class SimpleUserManager

java.lang.Object
  |
  +--SimpleUserManager
All Implemented Interfaces:
UserManager

class SimpleUserManager
extends java.lang.Object
implements UserManager

This class is provides the mapping between Impostor user identifiers and credentials for SSO-enabled websites. This class works very close with the HotmailYahooMailRHULMailRecognizer class; it returns the usernames and passwords for the Hotmail, YahooMail and RHUL webmail services, of identified Impostor users. The class is instantiated with the filename of the credential database. This is a simple text file following the format below.

ImpostorUser1
hotmailaccount1:hotmailpassword1
yahooaccount1:yahoopassword1
rhulaccount1:rhulAuthString1
ImpostorUser2
hotmailaccount2:hotmailpassword2
yahooaccount2:yahoopassword2
rhulaccount2:rhulAuthString2

In above example example there are two Impostor users, identified by ImpostorUser1 and ImpostorUser2. They have the usernames and passwords shown. The order of entries in the credential database file is crucial and must be the one shown in the example.


Constructor Summary
protected SimpleUserManager(java.lang.String filename)
           
 
Method Summary
 java.lang.String getPasswordForIdentifier(java.lang.Object id, RequestRecognizer rr)
          The Impostor daemon calls this method in order to determine the password that the Impostor user identified by the given identifier maintains at the website for which the given RequestRecognizer recognized a login request.
 RequestRecognizer getRequestRecognizerInstance()
          A UserManager implementation has to work very close with a RequestRecognizer implementation: the UserManager implementation knows the usernames and passwords of Impostor users at a specific set of websites, while the RequestRecognizer implementation recognizes HTTP login requests for exactly this set of websites.
 java.lang.String getUsernameForIdentifier(java.lang.Object id, RequestRecognizer rr)
          The Impostor daemon calls this method in order to determine the username that the Impostor user identified by the given identifier maintains at the website for which the given RequestRecognizer recognized a login request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleUserManager

protected SimpleUserManager(java.lang.String filename)
Method Detail

getUsernameForIdentifier

public java.lang.String getUsernameForIdentifier(java.lang.Object id,
                                                 RequestRecognizer rr)
                                          throws java.lang.Exception
Description copied from interface: UserManager
The Impostor daemon calls this method in order to determine the username that the Impostor user identified by the given identifier maintains at the website for which the given RequestRecognizer recognized a login request. The identifier is a String object, obtained from the user input from the Impostor login page, and the RequestRecognizer is the RequestRecognizer instance that recognized the HTTP request as a login request into a website.
Note that before calling this method the Impostor daemon checks the validity of the user identifier using the isValid method of the ChallengeResponseManager implementation with which the daemon was instantiated Thus, a UserManager and a ChallengeResponseManager have common user identifiers: the identifiers of Impostor users.

Specified by:
getUsernameForIdentifier in interface UserManager
java.lang.Exception

getPasswordForIdentifier

public java.lang.String getPasswordForIdentifier(java.lang.Object id,
                                                 RequestRecognizer rr)
                                          throws java.lang.Exception
Description copied from interface: UserManager
The Impostor daemon calls this method in order to determine the password that the Impostor user identified by the given identifier maintains at the website for which the given RequestRecognizer recognized a login request. The identifier is a String object, obtained from the user input from the Impostor login page, and the RequestRecognizer is a RequestRecognizer implementation previously obtained using the getRequestRecognizerInstance method.

Specified by:
getPasswordForIdentifier in interface UserManager
java.lang.Exception

getRequestRecognizerInstance

public RequestRecognizer getRequestRecognizerInstance()
Description copied from interface: UserManager
A UserManager implementation has to work very close with a RequestRecognizer implementation: the UserManager implementation knows the usernames and passwords of Impostor users at a specific set of websites, while the RequestRecognizer implementation recognizes HTTP login requests for exactly this set of websites. This method should return a new RequestRecognizer instance of the RequestRecognizer this UserManager implementation works with. The Impostor daemon calls this method for every incoming HTTP request, as it needs a fresh RequestRecognizer.
Note that before calling this method the Impostor daemon checks the validity of the user identifier using the isValid method of the ChallengeResponseManager implementation with which the Impostor was instantiated. Thus, a UserManager and a ChallengeResponseManager have common user identifiers: the identifiers of Impostor users.

Specified by:
getRequestRecognizerInstance in interface UserManager