Remote Affiliate Authentication

From TMM Wiki
Revision as of 17:51, 18 December 2008 by Trinidadr (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
NATS 3
NATS Extras
Remote Affiliate Authentication
Shopping Cart Sales
Moving Tours, Members' Area, and Galleries
Require W-9
Admin Areas
Fraud Report
NATS Content of the Day Module
NATS Load Balancing Module
Gallery Builder Module
Build Your Own Anything Module
NATS Code Wordpress Plugin
Error_message_display
TMMid

The following instructions explain how to let affiliates log into other applications using their NATS usernames and passwords.

The reseller passwords are encrypted in the NATS database to protect NATS and your data, but we've written a script that can receive the username and password of an affiliate to check if that information is correct.

Before using this script, you must setup the array of allowed IPs in your nats/includes/config.php like this:

$config['REMOTE_AUTH_IPS'] = Array ('10.10.10.107', '10.10.10.108');

Make sure you replace the values inside the parenthesis with your IP addresses and the IP address of the server authenticating against NATS.

The Script

The available input variables are:

  • username - the username to be authenticated
  • password - the password to be authenticated
  • ignore_active - if you wish to authenticate regardless of status in NATS database

The return from the script will be: OK - if the authentication was correct NOTOK - if the request came from a bad IP or the authentication was incorrect

Example PHP Post:

<?

$auth = file_get_contents("http://linkdomain/remote_auth.php?username=myuser&password=mypass");
if($auth == 'OK'){
//allow them access
}else{
//send away from here
}

?>

Replace linkdomain with your link domain.