[FAQ]Integration with ASP.NET Membership Providers

Author
APGvNext Sam
vNext Dev
  • Total Posts : 13198
  • Joined: 2001/05/23 00:00:00
  • Status: offline
2008/07/20 04:26:04 (permalink) Integration
0

Integration with ASP.NET Membership Providers

Our software uses Forms Authentication, so it is very easy to achieve Single-Sign-On between your site and the forum.

There are 3 possible scenarios for user integration through the ASP.NET Membership Provider model:
  1. You want APG vNext to connect to an existing membership provider
  2. You want APG vNext to connect to your existing membership database (non-membership provider based).
  3. You want to use the forum's membership database for managing members for your ASP.NET web site.
 

Scenario 1: You already have your own membership database + membership provider, and wish to integrate it with APG vNext.

Our software has built-in support for external (your own) ASP.NET Membership Provider. All you have to do is configure the APG vNext's web.config to connect with your membership provider.
 
With this option, you don't have to manually import existing users into APG vNext's database. APG vNext's built-in support for membership provider takes care of importing and authenticating through your membership provider automatically without you having to modify your existing code.
 
This is the most seamless way to integrate APG vNext with your own user database. Your users can change passwords and emails through APG vNext too.

Example:

If you're already using the SqlMembershipProvider provided by ASP.NET, you can plug it right into our software without any code change. Simply configure APG vNext's config files as follows:
  1. Put your membership provider information into APG vNext's web.config file (both the membership);
  2. In APG vNext's ~/config/sqlconnections.config file, add the connectionString for your membership provider;
  3. In APG vNext's ~/config/appSettings.config file, set the EnableMembershipIntegration key under appSettings to true;
Once it's set up correctly, refer to this SSO guide.
 
Note: if your own membership provider doesn't store the user name in the forms authentication cookie (e.g. storing email instead), you will need an alternative method for SSO. See this custom forms authentication technique for info.
 
Our software supports multiple membership providers. This means if your users come from more than one membership providers, you can add them all into web.config and the software will be able to authenticate all your users.

 

Scenario 2: You already have a membership database, but you don't have a membership provider built.

In this case, you need an alternative method to synchronize users between your own membership store and APG vNext membership table.
 
As you'll see under Scenario 3 (the next section), we have our own membership provider built for APG vNext's database. You can use our membership provider in your own registration page to import users into APG vNext's membership db.

For example, with our membership provider installed, you can use the standard provider method, Membership.CreateUser(), in your registration routine to insert new users directly into our forum db, OR you can call this method in a loop to import all existing users into APG vNext.

You can also call the MembershipUser.ChangePassword() method on your password changing form to submit the new password to our forum database (this may not be necessary because you can use Forms Authentication cookie to achieve single sign on).

Please refer to the scenario 3 below for more info on our own membership provider.
 
Alternatively, you can import users to APG vNext using the Fast Member Import feature available in the Admin control panel. You just supply a list of users (name, email, password) and the software will batch import users for you.
 

Scenario 3: You don't have a membership database yet and wish to use APG vNext's database for managing membership for your entire site.

In this case, you can use the JSON Membership / Role Provider we provide with the software. In other words, you can
  1. Build a login page on your site so that when a user is logged in, he is logged into the forum as well - achieving Single Sign On
  2. Build a registration page for your site and store users in vNext's database.
  3. In addition, you can
    1. Delete users from your site
    2. Allows Users to change / reset password
    3. Update Users' Email
    4. Approve users / Unlock (un-ban) users
    5. Build member list
    6. Look for users using email / login with wildcard character (%) support
    7. Get number of online users
A sample application is provided to show you the above functions, so you won't have any issue using this provider. This JSON based membership provider doesn't have any dependency on vNext's code, making it very easy to install on your site.

NOTE: this JSON membership provider doesn't support Password Retrieval and Password Q & A because vNext doesn't provide such functionalities. In addition, passwords are stored in salted-hash format only.
 
To use our JSON based membership provider, you do not have to set EnableMembershipIntegration in ~/config/appSettings.config to true.
 
This setting is only necessary when you want APG vNext to talk to an external membership provider (e.g. the standard SQLMembershipProvider as in Scenario 1 above). Under Scenario 3, APG vNext does not talk to any external membership provider. So, no extra configuration is needed in APG vNext's own web.config file under this scenario.

post edited by APGvNext Sam - 2013/08/27 16:13:27

Attached Image(s)

#1
APGvNext Sam
vNext Dev
  • Total Posts : 13198
  • Joined: 2001/05/23 00:00:00
  • Status: offline
Integration with external / forum user database (Example) 2009/05/22 15:15:10 (permalink)
0

Example Scenario:

  • We have an asp.net based system with a login/password setup for our members to access various areas of the system.
  • We also have committees that people can be members of.
  • And we want each committee to have a private forum area just for members of that committee.
  • Authentication for committee access is currently done by checking a membership table for the various committees.
 
Question: How can I use your software for this specific purpose?

Answer: You can first refer to scenario 2 above to see how to use our JSON Membership provider for authenticating / importing users into our db.

In addition to the Membership provider, we also have a JSON Role provider, which gives you the ability to assign members to certain user groups (in your case, committees).

The following is a step-by-step guide for setting up the desired environment:
  1. Set up various forums, with some of them marked as "private", accessible only to committee members
  2. Set up a user group (role) for each committee
  3. Mark these user groups as "Private Users" for the private forums created in step 1
  4. Use our JSON Membership provider and Role provider to
    1. Import your users into our system (Membership.CreateUser);
    2. Then, assign these users to the desired user group (committee) you set up in step 2 (Roles.AddUserToRole)
  5. Done.
post edited by Samuel - 2013/02/12 15:09:22
#2
Jump to:
© 2017 APG vNext Commercial Version 5.5