-
Notifications
You must be signed in to change notification settings - Fork 5
Integrating Your Campus Authentication System
BookSwap is designed to be integrated with external user authentication systems (e.g. via LDAP) to allow students to log in using their official school-provided electronic identities.
Since it would be impossible to accommodate all of the different campus authentication systems that are in use today, BookSwap's default User class (application/controllers/user.php) provides a minimal authentication implementation that serves as a starting point for BookSwap integrators. This implementation provides basic log-in / log-out functionality and demonstrates how to create a new BookSwap user account when a user logs in for the first time.
NOTE: The default User class does NO password checking and must be either expanded upon or replaced with a more complete authentication mechanism in production.
You can integrate your own campus's authentication system by fleshing out the login()
, logout()
, and authenticate()
methods as needed.
At minimum, your implementation must do the following when the user is successfully authenticated:
-
Retrieve the user's email address and first name from the external authentication system.
-
Assign these retrieved values to the
email
andfirst_name
variables, respectively, of the user's BookSwap user object. -
Persist the user's new (or updated) user object in the database.
-
Assign the user's user object to the
bookswap_user
session variable. For example:$this->session->set_userdata('bookswap_user', $user_object);