-
Notifications
You must be signed in to change notification settings - Fork 240
Home
Opauth is a multi-provider authentication framework for PHP.
Current version: 0.4.3
Pick and choose your favorite installation method:
Composer is a dependency manager for PHP.
To install Opauth core only, include opauth/opauth to your composer.json:
{
"require":{
"opauth/opauth": "*"
}
}Opauth requires strategies to work. We suggest that you add these packages as well for Facebook, Google and/or Twitter authentication support.
{
"require":{
"opauth/opauth": "*",
"opauth/facebook": "*",
"opauth/google": "*",
"opauth/twitter": "*"
}
}Run php composer.phar install
Download Opauth (ZIP) and unzip it.
Download additional strategies and place them in directories at path_to_opauth/Strategy.
Remember to name the directory name as the actual name of the strategy. For example, place Facebook strategy files in path_to_opauth/Strategy/Facebook so that FacebookStrategy.php can be found at path_to_opauth/Strategy/Facebook/FacebookStrategy.php.
If you prefer git clone, you can simply run the following without worrying about renaming:
cd path_to_opauth/Strategy
git clone git://github.com/opauth/facebook.git FacebookNote: You can have Strategy/ directory anywhere in your system. All you have to do is explicitly define strategy_dir in your Opauth configuration.
If you are using any of the following PHP frameworks, you can install Opauth as a plugin or extension. Follow the instructions at the respective packages:
- CakePHP (maintained by uzyn)
- CodeIgniter (maintained by destinomultimedia)
- CodeIgniter (maintained by mcatm)
- FuelPHP (maintained by andreoav)
- Laravel (maintained by fakeheal)
- PrestaShop (maintained by Onasusweb)
- Silex (maintained by icehero)
- Yii Framework (maintained by kahwee)
- Zend Framework 2 (maintained by lorenzoferrarajr)
- TYPO3 Flow (maintained by hfrahmann)
- Symfony2 (maintained by damianociarla)
- Symfony2 integration with FOSUserBundle (maintained by damianociarla)
Made a plugin? Edit this wiki and add yours!
-
Load Opauth configuration as an array.
-
Instantiate Opauth by passing the configuration.
<?php
require 'path_to_opauth/Opauth.php';
$Opauth = new Opauth( $config );-
Direct all authentication traffic to the Opauth instance.
You may want to use the included
.htaccessinexample/for this, or via Router in your PHP framework.Alternatively, you can explicitly pass in a
request_uriin Opauth configuration to "simulate" a request. -
Implement callback to expect auth response.
Refer toexample/callback.phpon how you should handle auth response.
All of the above are also implemented as an example in the example/ directory for your reference.
Questions? Ask us on Google Groups or IRC (#opauth on Freenode)
-
Home
with installation and usage instructions - List of strategies
- Opauth configuration
- Auth response
- Security in Opauth