Difference between revisions of "Remote Affiliate Authentication"
TMMStephenY2 (talk | contribs) |
|||
Line 6: | Line 6: | ||
}} | }} | ||
<!-- secure login reseller authentication --> | <!-- secure login reseller authentication --> | ||
− | |||
− | |||
− | + | [[NATS4]] contains a feature that allows [[Ct#Affiliate|affiliates]] to log in to other applications using their NATS usernames and passwords. This Remote Affiliate Authentication script will allow affiliates to log in to includes other Too Much Media products, such as [[CARMA]], [[RSSdish]], and [[TubeStudio]]. | |
− | NATS and | ||
− | |||
− | |||
− | Before | + | Although we have encrypted reseller passwords in the [[NATS]] database in order to protect NATS and your data, we have written a script that will be able to receive the username and password of an affiliate. With this, you will be able to check if that affiliate's information is correct. |
− | your nats/includes/config.php like | + | |
+ | Before you implement this script, you must first set up the array of allowed IPs in your nats/includes/config.php file like the following example: | ||
<pre> | <pre> | ||
Line 21: | Line 17: | ||
</pre> | </pre> | ||
− | + | Remember to replace the numeric values inside the parenthesis with your desired affiliates' IP addresses, as well as the IP address of the server authenticating against NATS. | |
− | addresses | ||
== The Script == | == The Script == | ||
− | The available input variables are: | + | The Remote Affiliate Authentication script has three variables that must be defined for it to work properly. The available input variables are: |
− | * username - the username to be authenticated | + | |
− | * password - the password to be authenticated | + | * '''username''' - the username to be authenticated |
− | * ignore_active - if you wish to authenticate regardless of status in NATS database | + | * '''password''' - the password to be authenticated |
+ | * '''ignore_active''' - if you wish to authenticate regardless of status in NATS database | ||
+ | |||
+ | After submitting the necessary information, the script will return a reply based on authentication. The return from your script will be: | ||
− | + | * '''OK''' - seen if the authentication was correct | |
− | OK - if the authentication was correct | + | * '''NOTOK''' - seen if the request came from a bad IP or if the authentication was incorrect |
− | NOTOK - if the request came from a bad IP or the authentication was incorrect | ||
− | + | The following is an example of a PHP Post using the Remote Affiliate Authentication script: | |
<pre> | <pre> | ||
Line 49: | Line 46: | ||
</pre> | </pre> | ||
− | Replace ''linkdomain'' with | + | Replace ''linkdomain'' in the above example with the link domain of your [[NATS]] install. |
[[Category:Need NATS4 Article]] | [[Category:Need NATS4 Article]] |
Revision as of 11:17, 27 July 2010
NATS 3
|
---|
NATS4 contains a feature that allows affiliates to log in to other applications using their NATS usernames and passwords. This Remote Affiliate Authentication script will allow affiliates to log in to includes other Too Much Media products, such as CARMA, RSSdish, and TubeStudio.
Although we have encrypted reseller passwords in the NATS database in order to protect NATS and your data, we have written a script that will be able to receive the username and password of an affiliate. With this, you will be able to check if that affiliate's information is correct.
Before you implement this script, you must first set up the array of allowed IPs in your nats/includes/config.php file like the following example:
$config['REMOTE_AUTH_IPS'] = Array ('10.10.10.107', '10.10.10.108');
Remember to replace the numeric values inside the parenthesis with your desired affiliates' IP addresses, as well as the IP address of the server authenticating against NATS.
The Script
The Remote Affiliate Authentication script has three variables that must be defined for it to work properly. 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
After submitting the necessary information, the script will return a reply based on authentication. The return from your script will be:
- OK - seen if the authentication was correct
- NOTOK - seen if the request came from a bad IP or if the authentication was incorrect
The following is an example of a PHP Post using the Remote Affiliate Authentication script:
<? $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 in the above example with the link domain of your NATS install.