Download DOWNLOAD
Forums FORUMS
Blogs BLOGS
Forge FORGE
Help HELP
Marketplace MARKETPLACE
DotNetNuke Home
You are here >   Community > Blogs
Register  |  Login

DNN Blog

Jun 10

Posted by: Michael Washington
6/10/2008 

DotNetNuke allows you to create child portals which operate as separate websites. In some cases one might find it desirable to authenticate the users of second portal against the user database of the first portal. I posted a module with code that demonstrates this:

http://www.adefwebserver.com/DotNetNukeHELP/Misc/PortalLogin.htm

Using The Module

To use the module, create a second portal and in that second portal, create a page and call it Login.

In the Site Settings for the portal, set the page as the Login page.

Install the PortalLogin module and place an instance of it on the Login page you created. Go into the Settings for the module and set the options:

 

Users will be authenticated against the specified portal and their account will be created in the current portal if one does not already exist. The roles for the user from the master portal will also be copied to the second portal.

Tags:

9 comment(s) so far...

Re: Authenticate users against the another portal

Terrific! The only other thing I would add is a way to choose a role(s) from the portal too. Thanks for the source!!

By ech01 on   6/10/2008

Re: Authenticate users against the another portal

To make it simple I simply delete all the roles for a user (in the second portal) and then copy the roles from the master portal that also exist in the second portal. So if you want to ADD a role for a user you add the role in both portals and then put the user in that role in the master portal. To DELETE a user from a role simply delete the role for the user in the Master portal.

By AdefWebserver on   6/10/2008

Re: Authenticate users against another portal

This is a great module. We have built a similar kind of thing and have run into a scalability issue. It is not practical to copy users and their roles when there are lots of users. It slows the system down so much.

What we did is leave the roles and match them up by rolename and got the corresponding roleid for that portal. If that role doesn't exist in that portal they don't have the role :) So if your adding custom roles make sure they exist on each portal you need them on

By rupurt on   6/10/2008

Re: Authenticate users against another portal

The users are actually not being copied. Only one unique username can exist in any of the portals. Only an entry for the user is being entered into the portal users table. The roles are being recreated each time a person logs in so I will see how this scales. However, I expect it to easily handle thousands of users a day.

By AdefWebserver on   6/10/2008

Re: Authenticate users against another portal

In the code there are some namespaces (linq-related) referenced which are probably not needed.

By schotman on   6/10/2008

Re: Authenticate users against another portal

I removed the linq namespaces and re-uploaded the code.

By AdefWebserver on   6/11/2008

Re: Authenticate users against another portal

Another note -- The code only copies a user that logs in. If your master portal has thousands of users they will NOT be copied to the second portal until each one tries to log into the second portal. Also they are not really copied, only an entry is made for them in the user portals table.

By AdefWebserver on   6/11/2008

Re: Authenticate users against another portal

I do realise that entries are only added to the userportals table.

Our scalability problem was more to do with adding a new portal. We added entries for every user in the system for the new portal.

It is a very good idea to only add them when they login to the other portal.

By rupurt on   6/12/2008

Re: Authenticate users against another portal

hi i am Darshit,,

We are having already developed site and database with us.

Now we are transfering the site to the DNN. But in existing

database we are having our own use table.

Actually we are having one seperate database say 'GMD' and

in that we are having one user table say 'User' where

already thoursands of users are created and the current

portal which developed on .Net freamword 2.0 is also working

on that. Currently the Authentication is working throught

this user table. In DNN when we logged or create a new user,

that will go at the DNN Database not to the 'GMD' database.

Due to a lot many users are created at GMD's database, we

want some way that we can authenticate the user via the

GMD's User table instead of the DNN's database.

Can any one please tell me how we can have a login module in

such a manner which will connect to our database.


Regards,
Darshit

By Darshit on   11/5/2008

Networks

Follow DNNCorp on Twitter

LinkedIn

Follow us on Twitter @DNNCorp or join the DotNetNuke Community on LinkedIn

Sponsors

DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation

Hosted by MaximumASP