Download the PHP package openclerk/users without Composer
On this page you can find all versions of the php package openclerk/users. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package users
openclerk/users
A library for User management in Openclerk, supporting password, OpenID and OAuth2 login.
Installing
Include openclerk/users
as a requirement in your project composer.json
,
and run composer update
to install it into your project:
Make sure that you run all of the migrations that can be discovered through component-discovery; see the documentation on openclerk/db for more information.
Features
- Automatic session management
- Autologin
- Optionally require emails for all non-password users with
users_require_email
config parameter - Forgot password/reset password functionality
- Users can optionally have multiple OpenID/OAuth2 identities and one password associated with an account
Using
This project uses openclerk/db for database management and openclerk/config for config management.
First configure the component with site-specific values:
You can now register and login users using a variety of authentication methods. The component assumes that only one user can own any one email address, and that all users need to define an email address as their primary key.
Password
OpenID
You need to set a redirect value for all the OpenID callbacks, normally the same URL as the current script.
OAuth2
For Google OAuth2, login to your Google Developers Console, create a new Project, and visit APIs & Auth:
-
APIs: Enable Contacts API and Google+ API
- Credentials: create a new Client ID of type web applicaton, setting your permissible Redirect URI to the login and redirect URLs used in your application. Use the generated Client ID and Client Secret in your site configuration (above).
For Facebook OAuth2, login to your Facebook Developers Console, create a new App, and visit the Dashboard page for this app to get your App ID and App Secret.
For GitHub OAuth2, register a new GitHub application, and use the generated Client ID and Client Secret in your site configuration (above).
More OAuth2 providers provided by default will be coming soon.
Events
openid_validate
Triggered when OpenID validation occurs, after the user has returned with an OpenID mode.
If any event returns false
, OpenID validation will be cancelled.
Event parameter: $light object
oauth2_auth
Triggered when OpenID authentication occurs, after the user has returned with an OAuth2 code.
If any event returns false
, OpenID validation will be cancelled.
Event parameter: $provider object
user_deleted
Triggered when a user is deleted through User::delete()
.
TODO
- Track last_login
- Removing identities
- Tests
- Publish on Packagist
- Add user names, other user properties
- Documentation on adding additional user parameters
- Documentation on autologin with cookies
- How to add, change, remove email addresses
- More events
All versions of users with dependencies
openclerk/config Version ^0.1
soundasleep/php-helpers Version dev-master
league/oauth2-client Version ~0.6
soundasleep/lightopenid Version dev-master
openclerk/events Version ^0.2