Install

From AuthAny
Jump to: navigation, search

Configure Server Settings

  1. Insure that your server's time is current. This is required for services that check the request timestamp. Otherwise these services will reject the request.
  2. Edit  ./library/AuthAny/Config/constants.php


date_default_timezone_set('UTC');
define( 'AUTHANY_DEBUG', false );
define( 'AUTHANY_BASEURL', 'http://demo.authany.com' );
define( 'AUTHANY_ROOT', dirname( dirname( __FILE__ ) ) );
define( 'AUTHANY_LOGIN_ROOT', '/login/' );
define( 'AUTHANY_LIB_ROOT', dirname( AUTHANY_ROOT ) );
define( 'AUTHANY_PROVIDER_ROOT', AUTHANY_ROOT.'/Provider' );


  • Change:
  1. AUTHANY_BASEURL — change to your site's URL. Do not include a trailing slash (/).
  2. AUTHANY_LOGIN_ROOT — change to your site's login path. Include a slash (/) at the beginning & end of this option.


Configure Local Login (Optional)

  • Edit  ./library/AuthAny/Config/AuthAny.ini


[login]
; class or function
callbackType		= "class"
 
; only used if callbackType is 'function'
callbackFunction	= ""
 
; only used if callbackType is 'class'
callbackClass		= "AuthAny";
callbackMethod		= "loginLocal";


  • Change:
  1. callbackType — this specifies the type of callback to execute after login.
    Valid options are class or function.
  2. callbackFunction — this is the function that will be called to login a user locally.
  3. callbackClass — this is the class that contains the callback function. This is only applicable if callbackType is class.
  4. callbackMethod — this is the function within the specified callbackClass' that will be executed to login a user locally.


Configure Providers

  • Edit your desired provider:  ./library/AuthAny/Provider/config/*.ini


The options are self-explanatory:

:
; AuthAny
; Facebook Config
;
; @author		CloneUI <code@cloneui.com>
; @copyright		2014 CloneUI
; @link			http://cloneui.com
; @link			http://authany.com
; @license		Commercial
;
; @since		Friday, June 20, 2014, 07:24 PM GMT+1
; @modified		$Date: 2014-06-24 01:19:35 -0700 (Tue, 24 Jun 2014) $ $Author: dev@cloneui.com $
; @version		$Id: facebook.ini 13 2014-06-24 08:19:35Z dev@cloneui.com $
;
; @category    		Provider Config
; @package     		AuthAny
; 
 
[api]
apiEndpoint	= "https://graph.facebook.com";
authEndpoint	= "https://www.facebook.com/dialog/oauth";
oauthEndpoint	= "https://graph.facebook.com/oauth/access_token";
scope		= "email";
responseType	= "code";
 
[live]
enabled		= 1
appId		= "XXXXXXXXXXXXXXXX"
appSecret	= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
redirectUri	= "login/facebook";
 
[dev]
enabled		= 0
appId		= "XXXXXXXXXXXXXXXX"
appSecret	= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
redirectUri	= "login/facebook";


Change the Permission Scope of the API if desired. Some sites required the scopes be separated by spaces, others require commas.
Check the corresponding site for the proper syntax.

[api]
scope		= "<CHANGE_TO_MATCH_YOUR_REQUIREMENTS>";


Change the API Settings in the [live] section. You will receive this info after registering an application on the target site.
redirectUri — this is the location to redirect the user to after a login attempt. Do not include a preceding slash (/).

 
[live]
enabled		= 1
appId		= "XXXXXXXXXXXXXXXX"
appSecret	= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
redirectUri	= "login/facebook";