PHP code example of uzyn / cakephp-opauth

1. Go to this page and download the library: Download uzyn/cakephp-opauth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

uzyn / cakephp-opauth example snippets


   
   CakePlugin::load('Opauth', array('routes' => true, 'bootstrap' => true));
   

   
   CakePlugin::load('Opauth', array('routes' => true, 'bootstrap' => true));
   
   // Using Facebook strategy as an example
   Configure::write('Opauth.Strategy.Facebook', array(
       'app_id' => 'YOUR FACEBOOK APP ID',
       'app_secret' => 'YOUR FACEBOOK APP SECRET'
   ));
   

   
   Router::connect(
       '/opauth-complete/*', 
       array('controller' => 'users', 'action' => 'opauth_complete')
   );
   

    // APP/Controller/UsersController.php:
   class UsersController extends AppController {
       public function opauth_complete() {
           debug($this->data);
       }
   }
   

 // APP/Config/bootstrap.php
Configure::write('Opauth.path', '/your-cake-app/auth/');