-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Opauth is a multi-provider authentication framework for PHP.
Current version: 0.4.3
Pick and choose your favorite installation method:
###i. Via Composer
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
###ii. Manual download
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 Facebook
Note: You can have Strategy/
directory anywhere in your system. All you have to do is explicitly define strategy_dir
in your Opauth configuration.
###iii. As plugin on other PHP frameworks 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] (https://github.com/FakeHeal/opauth-laravel) (maintained by fakeheal)
- [PrestaShop] (https://github.com/Onasusweb/PrestaShop-Opauth) (maintained by [Onasusweb] (https://github.com/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
.htaccess
inexample/
for this, or via Router in your PHP framework.Alternatively, you can explicitly pass in a
request_uri
in Opauth configuration to "simulate" a request. -
Implement callback to expect auth response.
Refer toexample/callback.php
on 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