code: public String login( String user, String pwd ) {
  
  		String token = null;
  		try {
  			this.authService.authenticate( user, pwd );
  
  			token = UUID.randomUUID().toString();
  			Long now = new Date().getTime();
  			this.tokenToLoginTime.put( token, now );
  			this.tokenToUsername.put( token, user );
  
  		} catch( LoginException e ) {
  			this.logger.severe( "Invalid login attempt by user " + user );
  		}
  
  		return token;
  	}
docs: Authenticates a user and creates a new session.
  @param user a user name
  @param pwd a pass word
  @return a token if authentication worked, null if it failed