Advertisement
europcsolutions

Ninjauth and Twitter

Jul 15th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.10 KB | None | 0 0
  1. <?php
  2. config.php: main config
  3. ------------------------------------
  4. 'packages'  => array(
  5.     'orm',
  6.     'auth',
  7.     'oauth',
  8.     'oauth2',
  9.     'ninjauth'
  10. ),
  11.  
  12.  
  13.  
  14. ninjauth.php: NinjAuth config
  15. -------------------------------------
  16. 'providers' => array(
  17.        
  18.     'facebook' => array(
  19.         'id' => '396498410397264',
  20.         'secret' => '974163a3254487c48d023a9b28231cb0',
  21.         'scope' => array( 'email', 'offline_access' ),
  22.     ),
  23.        
  24.     'twitter' => array(
  25.         'key' => 'HS68DfAm2CNyNFb9lvhNlQ',
  26.         'secret' => 'UGRn2pYE39dpcRmHZjKiJ0hkiWGYWkAwmq6jQznw4',
  27.     ),
  28. ),
  29.  
  30.  
  31.  
  32.  
  33. auth.php: NinjAuth controller
  34. --------------------------------------
  35. class Controller_Auth extends \NinjAuth\Controller {}
  36.  
  37.  
  38.  
  39. login-form.php: login form and links for NinjAuth
  40. ---------------------------------------
  41. ?>
  42. <p>
  43.     <a href="<?php echo Uri::create( 'auth/session/facebook' ) ?>" class="facebook">Connect with Facebook</a>
  44. </p>
  45. <p>
  46.     <a href="<?php echo Uri::create( 'auth/session/twitter' ) ?>" class="twitter">Connect with Twitter</a>
  47. </p>
  48. <p>
  49.     <a href="<?php echo Uri::create( 'auth/session/google' ) ?>" class="google">Connect with Google</a>
  50. </p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement