Opauth is a multi-provider authentication framework for PHP.
Opauth enables PHP applications to perform user authentication really easily.
Try out Opauth for yourself at http://opauth.org
1.0.x is currently under preview release and not to be used for production yet. See release notes for details.
Opauth API and functionalities are fully ready for evaluation. Please try it out and let us know what you think.
1.0.x is not backward-compatible with 0.x. See migration guide on how to migrate Opauth 0.x applications and strategies.
For current stable release, see 0.4.x.
Opauth provides a standardized interface between PHP applications and authentication providers.
Opauth as a framework provides a set of API that allows developers to create strategies that work in a predictable manner across PHP frameworks and applications.
Opauth works well with other PHP applications & frameworks.
-
Composer require Opauth core and Opauth strategies. Add the following to your application's
composer.json
:{ "minimum-stability": "dev", "require": { "opauth/opauth": "~1.0", "opauth/facebook": "~1.0" } }
Note: While Opauth 1.0.x still is in development, your root
composer.json
will need to set its minimum-stability todev
.Install them
$ composer install
-
Configure Opauth.
Create a fileopauth.php
that is accessible athttp://localhost/opauth.php/
.<?php $config = array( 'Strategy' => array( 'Facebook' => array( 'app_id' => 'YOUR APP ID', 'app_secret' => 'YOUR APP SECRET' ) ), 'path' => '/opauth.php/' );
-
Instantiate and run Opauth
<?php $Opauth = new Opauth\Opauth\Opauth($config); try { $response = $Opauth->run(); echo "Authed as " . $response->name . " with uid" . $response->uid; } catch (OpauthException $e) { echo "Authentication error: " . $e->getMessage(); }
-
Point your browser to
http://localhost/opauth.php/facebook
to see it in action.
See Opauth documentations for more infomation.
- PHP 5 (>= 5.3)
- Composer
We welcome your contributions to Opauth:
- Be free to submit pull requests.
- Inform Opauth community via the discussion group and/or @opauth if you have authored a new strategy, new plugin or done anything cool with Opauth.
- Join us at IRC: #opauth on Freenode for any discussions.
- Discussion group: Google Groups – Primary channel for support, especially usage questions.
- Issues: Github Issues
- IRC: #opauth on Freenode
- Twitter: @opauth
The MIT License
Copyright © 2012-2014 U-Zyn Chua (http://uzyn.com)
- OmniAuth for Ruby – The project that inspired Opauth.
- Homenaje – The font for Opauth logo. Designed by Constanza Artigas Preller and Agustina Mingote. SIL Open Font Licence, 1.1.