Authentication providers

Is possible to authenticate users on Nearforums using different providers: Facebook, Twitter, ASP.NET Membership, Custom database and OpenId webring.

Facebook

If you want to allow your users to log in with their facebook account, you will need to register a new application at facebook.com:
  • Go to http://www.facebook.com/developers/
  • Click on "Set up a new application"
  • Fill in the basic info, including application name, description and website url and save.
  • Once you have a application id and application secret, copy them to the Site.config file in the folder <... site root...>/Config/Site.config.

Twitter

If you want to allow your users to log-in with their twitter account, you will need to register a new application at twitter.com:
  • Go to http://twitter.com/apps.
  • Click on "Register a new application"
  • Fill in the basic info, mark your application as "Browser type" application and enter your homepage (ex: http://www.yourforumsite.com) as callback url and save.
  • Once you have created the twitter application, copy the given consumer key and consumer secret to the Site.config file in the folder <... site root...>/Config/Site.config.

ASP.NET Membership

To enable or disable this functionality (enabled by default), locate the formsAuth element under authenticationProviders on the Site.config file and set the defined attribute to true or false.
Afterwards you should set the standard configuration for ASP.NET Membership.

Custom database authentication

If the database of your main site is accessible, through a network connection, from the Nearforums site you can set up a custom db authentication provider. To do so, create a procedure in your main db following this instructions,
Once you created it, add a new connection string pointing to your db (do not remove the connection string named "Forums"), in the web.config file located in the root folder of your Nearforums site. For example:
<add name="MainDb" connectionString="Data Source=YourDbServer;Initial Catalog=MainDb;User ID=sa;Password=12345678" providerName="System.Data.SqlClient"/>
Then, edit the element custom inside authenticationProviders on the Site.config file located in the folder Config. For example:
<customDb
connectionStringName="MainDb" Same name as in the web.config file
storedProcedure="SPNearforumsAuthenticateUser"
registerUrl="http://yourmainsite.com/register/"
forgotPasswordUrl="http://yourmainsite.com/forgot-password/"
allowChangeEmail="false"
accountEditUrl="http://yourmainsite.com/account/"/>

OpenId webring

This feature is specially useful for websites that already have a user repository, host a main site in another domain or subdomain (ex: www.mainsite.com and forum.mainsite.com) and you can't expose the repository to Nearforums by other methods.
It requires extra development work in your main site.
To enable this functionality, you must expose a OpenId Service Provider from your main site. If you are using .net in your main site, you can do it easily using Dotnetopenauth.
Once you create it, copy the url of the service provider to the element ssoOpenid in the configuration file Site.config, located in the folder <... site root...>/Config/Site.config.

Last edited Sep 4, 2012 at 1:06 PM by jorgebg, version 11

Comments

No comments yet.