Configure Server Settings
- 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.
- 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' );
- AUTHANY_BASEURL — change to your site's URL. Do not include a trailing slash (/).
- 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";
- callbackType — this specifies the type of callback to execute after login.
Valid options are class or function.
- callbackFunction — this is the function that will be called to login a user locally.
- callbackClass — this is the class that contains the callback function. This is only applicable if callbackType is class.
- callbackMethod — this is the function within the specified callbackClass' that will be executed to login a user locally.
- Edit your desired provider: ./library/AuthAny/Provider/config/*.ini
The options are self-explanatory:
: ; AuthAny ; Facebook Config ; ; @author CloneUI <firstname.lastname@example.org> ; @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: email@example.com $ ; @version $Id: facebook.ini 13 2014-06-24 08:19:35Z firstname.lastname@example.org $ ; ; @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";