GetAuthenticationProvider('FooAuthenticationProvider'); * * Custom authentication providers should be placed in: * {HOME}/classes/authenticationProviders and should be named FooAuthenticationProvider.class.php. * Custom authentication providers can be invoked by doing: * $app->GetAuthenticationProvider('foo',true); // true --> custom * * @author s.khudikyan * */ interface Org_Apache_Oodt_Balance_Interfaces_IApplicationAuthenticationProvider { /** * Constructor - Instantiate the provider but do not yet connect * to the underlying system. * */ public function __construct(); /** * Initiate a connection to the underlying system. * * @return boolean True or false depending on the result */ public function connect(); /** * Disconnect from the underlying system and perform any cleanup * operations necessary. * * @return boolean True or false depending on the result */ public function disconnect(); /** * Check if a valid user has logged in. * * @return boolean True or false depending on the result */ public function isLoggedIn(); /** * Determine whether privileges will be granted to a particular user * using credentials provided. * * @param $username mixed The username is usually a string. * @param $password mixed The password is usually a string. * @return mixed True or false depending on the success of login */ public function login( $username, $password ); /** * Ending the user's session to the underlying system. * */ public function logout(); /** * Get current user's username. * */ public function getCurrentUsername(); /** * Change current user's password. * * @param $newPassword string * @return boolean True or false depending on the success of password change */ public function changePassword( $newPassword ); /** * Checks if user is logged in. If true, validates rules from config file and uses * {@link changePassword} to change password. * * @param $newPass string The new password * @param $encryptionMethod string The encryption method used */ public function validateChangePassword( $newPass, $encryptionMethod = "SHA" ); /** * Retrieves the set of attributes from the user's entry * * @param $username string The user for which attributes will be returned * @param $attributes array Attributes to retrieve * @return array An empty array or requested attributes */ public function retrieveUserAttributes( $username, $attributes ); /** * Creates a new account with the user information provided * * @param $userInfo array Can include different values depending on provider * i.e. username, firstname, lastname, email */ public function addUser( $userInfo ); /** * Uses {@link retrieveUserAttributes} to retrieve information about the provided * user. If count of array returned is > 0 then the username is not available. * * @param $username string The username for which a user is checking the * availability of */ public function usernameAvailability( $username ); /** * Updates user information with the values of provided attributes * * @param $newInfo array (key, value) based array, where keys are the user's * entry attribute ids and the values will replace * the values of those attributes */ public function updateProfile( $newInfo ); }