Custom Forms Authentication cookie for Single Sign On
If you are trying to integrate the software into your own site, and are in the following situation:
- You are already using a Forms Authentication Cookie (Cookie A) for authentication (login) for your site (whether or not you have your own membership provider), and
- Your Forms Authentication Cookie does not contain the user name for the user, but email or some other info to identify the users (e.g. your own membership provider authenticates user with email instead of user name), and
- You want to achieve single-sign-on between your site and the forum, i.e. you want your users to log on from your site's sign in page, and have the user recognized automatically by the forum.
You will not be able to use the built-in membership integration
feature we have in the software. What you will have to do is to find out
- a method to import members to our db, and
- a mechanism for the forum to recognize a logged on user from your site.
1. For importing members
You can choose one of the following options:
- do it manually using the Fast Member Import feature in the AdminCP;
- call our spRegister stored procedure on your own page when user finishes the registration process on your site;
- use our Site Integration Package's Membership Provider for our forum to insert members into our db when user finishes the registration process on your site (similar to the above);
2. For single sign on support
You will need to create a separate Forms Authentication Cookie ( Cookie B
; in addition to your own site Forms Authentication Cookie) that contains the user name for the forum to recognize the user. Please use the attached sample code FormsAuth.zip
to see how this can be done (read the comment inside the code). Please install the sample code as a Web Application
before running it.
2 prerequisites for this to work:
- Your site must share the same Machine Key with the forum (same machinekey specifications in both web.config files);
- You must use different Forms Authentication Cookie names for Cookie A & Cookie B (site & forum);
Our software has native support for Login and Registration page Redirection
, meaning you can specify your own login page and registration page in the AdminCP and the software will redirect users to your specified pages when they click on the login / registration links on the forum. This way you can ensure that users only perform the 2 tasks on your site pages.
post edited by Samuel -