Authentication service

Implementing an alternative authentication service to Jadu's native methods requires a new adapter to be developed.

Code Library

Jadu recommend adding the new code library to the /jadu/custom directory as this will prevent issues during patches.

Adapter

The adapter must implement Jadu_Service_User_AdapterInterface (jadu/Service/User/Adapter/AdapterInterface.php).

A list of the required methods and their purpose is below:

  • authenticate($identity, $credential)
    • Authenticate the identity and credential and return the ID of the User record if correct. If incorrect return NULL.
  • save(User $user, array $answers = array(), $emailUser = true)
    • Save the User and any marketing targeting rule answers.
  • updatePassword($userID, $password)
    • Update a user's password.
  • updateAccessLevel($userID, $accessLevel)
    • Update the access level of the user with the given ID
  • sendPassword($identity)
    • Send the password to the provided email address.
  • sendUserPasswordResetCode($user, Jadu_Security_PasswordReset $passwordReset)
  • delete($userID)
    • Deletes a user with the specified id.
  • getNumUsers()
    • Returns the current number of users.
  • getNumUsersQuery($query)
    • Returns the number of users who are found with the search string.
  • getNumUsersRecent($interval)
    • Returns the number of users who have registered since the interval specified.
  • getNumConfirmedUsersRecent($interval)
    • Returns the number of users who have registered since the interval specified and authenticated.
  • getAllUsers($orderBy = 'id', $orderDirection = 'ASC')
    • Retrieves all users.
  • getAllUsersLimit($offset, $limit, $orderBy = 'id', $orderDirection = 'ASC')
    • Retrieves a specified number of users.
  • getAllUsersLimitQuery($offset, $limit, $query, $orderBy = 'id', $orderDirection = 'ASC')
    • Retrieves a specified number of users based on a search term.
  • getAllUsersLimitRecent($offset, $limit, $interval)
    • Retrieves a specified of number users that have registered in the interval specified.
  • getAllContactableUsers()
    • Retrieves all users who have agreed to be contacted by email.
  • getUser($id)
    • Retrieves a single User.
  • getUserByIdentity($identity)
    • Retrieves the User by the identity
  • getUserIdByIdentity($identity)
    • Retrieves the User ID by the identity
  • canRegister()
    • Whether new registrations are accepted
  • canUpdate()
    • Whether users can update their details from within Jadu
  • canUpdatePassword()
    • Whether users can update their password from within Jadu
  • canRemindPassword()
    • Whether users can reset password from within Jadu
  • isStandard()
    • Whether the ID returned by the authenticate method is the primary key of a record in the JaduUsers table. If false is returned then a new JaduUsers link record will be created upon each unique login.
  • isIdentityEmail()
    • Whether the identity is the user's e-mail address
  • getLastLogin($userID, $dateFormat = FORMAT_DATE_FULL)
    • Get the date that the user last logged in
  • getLastLoginID($userID)
    • Get the row ID of the users last login
  • getSignInURL()
    • Get the sign in url
  • getSignOutURL()
    • Get the sign out url
  • getRegisterURL()
    • Get the register form url
  • getAccountURL()
    • Get the user account page url
  • getPasswordReminderURL()
    • Get the password reminder form url
  • getUpdateURL()
    • Get the update details form url
  • getUpdatePasswordURL()
    • Get the update password form url
  • setUserEmailConfirmed($userID);
    • Update the given user to have their email marked as verified
  • SetUserEmailUnconfirmed($userID, $email);
    • Update the user to have their email marked as verified and optionally send a email requesting verification
  • isUserEmailConfirmed($userID);
    • Get whether this user has verified their email address

Config

There are no xml config files associated with the adapters distributed with Continuum CMS, however additional database values should be defined when using the default CAS adapter.

INSERT INTO JaduConstants (name, value, description, editable, type) VALUES ('CAS_ENDPOINT_HOST', '{{ endpoint }}', '' , 1, 'string');

INSERT INTO JaduConstants (name, value, description, editable, type) VALUES ('CAS_ENDPOINT_PORT', '{{ port }}', '' , 1, 'int');

INSERT INTO JaduConstants (name, value, description, editable, type) VALUES ('CAS_ENDPOINT_CONTEXT', '{{ context }}', '' , 1, 'string');

INSERT INTO JaduConstants (name, value, description, editable, type) VALUES ('CAS_ENDPOINT_SSL_ENABLED', '{{ ssl enabled }}', '' , 1, 'bool');

INSERT INTO JaduConstants (name, value, description, editable, type) VALUES ('CAS_CERTIFICATE_LOCATION', '{{ path to SSL certificate }}', '' , 1, 'string');

Enabling the adapter

Enable the CAS adapter by setting the constant USER_ADAPTER the name of your adapter class.

Installed adapter values

Service Adapter name
Default
CAS Jadu_Service_User_Adapter_CAS

results matching ""

    No results matching ""