Content is still under development. For additional information please consult our community forums, knowledgebase or open a support ticket.

Contents

Documentation

InstantForum.NET Single Sign-On Example


To assist developers integrating InstantForum.NET into an existing ASP.NET web site we've put together the example available for download at the bottom of this article. The download targets Visual Studio.NET 2010 & .NET 4.0.

Single sign-on with InstantForum.NET is very easy if your web site or web application already uses standard ASP.NET forms authentication or the ASP.NET membership controls & providered introduced with the .NET 2.0 framework.

The Single Sign-On Example

This example attached below consists of a basic Visual Studio.NET 2010 ASP.NET 4.0 web site. This template provides authentication out the box by taking advantage of the standard ASP.NET membership controls & providers...

A copy of InstantForum.NET has been installed within a standard child folder within the root of the sample web site called "InstantForum"….



Please note in the download available below we've removed all InstantForum.NET files not relevant to this sample.

How does the sample web site store login credentials / membership information?

The sample web site uses the standard ASP.NET membership providers. The purpose of the provider is to provide a layer of indirection between membership controls, like the LoginControl, and the data store. In our example we use the SqlMembershipProvider meaning our user data will be stored in SQL Server.

To create the required database for SQL Server you can use the ASP.NET SQL Server Registration Tool . To launch this wzard you'll need to open your command prompt (in the context of an administrator) and navigate to…

[drive:]\%windir%\Microsoft.NET\Framework\v2.0.50727

Once there simply type "Aspnet_regsql" within the command prompt to launch the wizard.

For can read more on the ASP.NET SQL Registration Tool at http://msdn.microsoft.com/en-us/library/ms229862.aspx

Running the Sample

To run this sample you'll need to open the provided "WebSite.vbproj" project within Visual Studio.NET...



To run the sample simply hit CTRL+F5 and this should launch the sample web site in your bwoeser. To test we'll create a new account...

Before running the sample you may need to update the database connection strings within the web.config file. Also you should ensure you've downloaded the full sample from InstantASP directly.


Once we register we are automatically authenticated as the ASP.NET membership controls generated the required forms authentication ticket. We can see now on the main web site we are now logged in...



Then once we visit the forum we'll see the login persist...



To download the sample web site please use the link below. This sample is provided for Visual Studio.NET 2010 and targets .NET 4.0 by default. We've removed all InstantForum.NET files not relavent to this sample . If you would like a complete download containing a full copy of InstantForum.NET & you’re an existing customer please contact us.

This example works by simply adding the user information using the InstantForum.NET API to the InstantForum.NET database tables during your main site web sites registration. The ASP.NET membership controls used in this sample already generate the forms authentication ticket required by InstantForum.NET so we don't need to call any additional code within InstantForum.NET to create the forms authentication ticket.

As InstantForum.NET is part of the web site the forms authentication ticket persists without any special considerations. If you've installed Instantforum.NET within a separate web site or web application you may wish to ensure the forms authentication ticket can be shared across your main web site and InstantForum.NET. For further information please see "InstantForum.NET Single Sign-On Considerations".



Attachments


InstantForum2010SSOSample.zip InstantForum2010SSOSample.zip (3.25 MB, 330 views)



© 2011 InstantASP Ltd. All Rights Reserved. Powered by InstantKB.NET 2011-1