Advanced User Integration Tutorial

From PAS Documentation
Jump to: navigation, search

Contents

Advanced User Integration Tutorial

The goal of this tutorial is to give a brief overview of the steps required in setting up an Advanced User Integration system between the PAS database and your own main website. This setup is used on LeggoPoker and several others, and is often employed when you have a main website and a full website such as 'www.MainWebsite.com' for your main content, and then 'rakeback.MainWebsite.com' for your rakeback website.

Moderate to Advanced technical experience may be required to successfully setup an advanced integration.

PAS also can provide this service for a one-time fee. Contact Arthur (at) PokerAffiliateSolutions.com for additional information.

Quick Links

Advanced Integration FAQ - Frequently Asked Questions
Add New User - Add User API Documentation
Update Existing User - Update Existing User API Documentation

Step 1 - Adding Users

The first thing you will want to do is to edit your existing signup procedure code so that it makes a request to the Add New User API call. By doing this, any time a user is created in your database he will also be created in the PAS database. It is very important that the user databases stay synchronized at all times.

Note:
If you will be implementing full login integration, such that a user stays logged in between both websites, you MUST use the 'hashed' optional variable and set it to TRUE. Similarly, if you choose to use this functionality you MUST also set this variable to TRUE in Step 2.

If you simply want uses to be able to use the same username and password on both websites, but keeping them logged in is not important, then you MUST NOT set the 'hashed' variable to TRUE.

Step 2 - Keeping Users Updated

The next step will be to edit your existing 'Modify Profile' page so that when a user updates his details, it also updates his details in the PAS database. You will want to use the Update Existing User API call in order to ensure that the user details are kept consistent between both your database and your PAS database.

Note:
If you are not going to be using full login integration (users can use the same login information on both websites but are not kept logged in between them), then this is your FINAL STEP and you are finished with your Custom Integration!

Step 3 - Login Integration

In this step you will be setting up the cookie system that enables a user to stay logged in between both websites. You will need to edit your existing Login system so that on the final page that is displayed to a user once a user is authenticated, a two special cookies must be set on your users machine in order to keep that user logged in between both sites. These cookies are called "mid" and "epw". They are explained below:

The 'mid' Cookie

This cookie will be the Primary Key, as stored in the PAS Database, of the user you have authenticated.

The 'epw' Cookie

This cookie must be the hashed password that you provided when you used the Add User & Update User API calls.

Cookie Path

The cookie MUST be accessible by the PAS server, which means that you MUST set the path to: ".MAINDOMAIN.com"
This allows both your server and the PAS server access to the cookie. The '.' prior to the domain is the crucial piece that enables this cross-talk behavior.


Note:
Two requirements MUST be met in order to keep a user logged in between both websites.
1) You MUST be using 'hash' = TRUE when updating & adding users (see above).
2) This will ONLY work if your main domain and subdomain use the same top-level domain. Examples are below:
THIS WORKS: rakeback123.MAINWEBSITE.com and www.MAINWEBSITE.com
THIS DOES NOT WORK: rakeback123.YOURWEBSITE.com and www.SECONDWEBSITE.com


Step 4 - Finalizing Integration

At this point, you should be able to login from your main website and proceed to the rakeback website and still be logged in. We now have to wrap up a few loose ends so that the inverse works as well; Logging in on the PAS side should log you into your main website as well.

Edit the FORM ACTION on your PAS Login Forms

You will need to change all login forms within your PAS Rakeback Website CMS to point to your Login script on your Main Website. You may optionally wish to add a referring URL check to your login script at this time, so that a user is redirected to wherever they logged in from.

Edit the Quick Signup Forms

You will need to change the Quick Signup Forms (but *NOT* the Quick Add Tracker forms) so that only logged in users can add a tracker. If you allow users to use the 'Quick Signup Form' on your rakeback site, the user will not be added to your database and so user will be unable to login to either the Rakeback website or the Main website.

Finished!

If you arrived here, you're finished! You login integration should be completely and fully functional.

Have questions or comments? Interested in additional functionality, or prefer that PAS installs your custom integration for you?

Email us at: Publishers (at) PokerAffiliateSolutions.com

Personal tools