Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.04.3.x Replacing Membership / Profile / Role Providers...4.3.x Replacing Membership / Profile / Role Providers...
Previous
 
Next
New Post
6/28/2006 6:09 PM
 

I need to replace the default DNN Membership / Profile and Role providers and do not know where to begin... So, I guess I should give you an idea of my plans or at least what it is that I need, and then ask for advice/help or a point in the direction where I can find information that will help me on my way.

The portal is being built as a web application for a single specific task: Multi-tenant Exchange / MS LCS server application hosting. I have no care about what / how things happen on the back end... I only provide the GUI through the portal to manage / configure everything.

Communication is via web service which provides me with all the data based on privilege levels after authentication. I have the web service provider functioning properly so that I can gather data with not much effort. However, in getting to this point in development, I have been bypassing DNN's authentication process. I now wish to spend some time and do the authentication correctly.

The web service provides me with:

  • The authentication mechanism.
  • All user data.
  • much, much more, but I think that it is irrelevant to the task at hand.

The web service is a virtual datastore which aggregates and returns data (based on my privilege level) all data (user / customer / other) which could be stored through out many different datastore and types of datastores. i.e. LDAP / AD / SQL / FlatFile and many other types... This "virtual datastore" will provide everything I should need in order to map my user object to a UserInfo object or a Membership object or????

I need to accomplish:

  • Authentication to the web service which should also be the DNN authentication.
  • I am required to have no user information stored in the DNN database (this is sensitive data), I want no synchornization between user data in the web service and user data in DNN. Everything I need should come from the web service. There may be minor flexibility in this rule, but in general, any information about a user that is not stored within the web services virtual datastore is a no-no.
  • Roles are static and will not be modifiable. The User to Role mapping will also be returned from the web service.
    I think that this might be an issue since DNN looks to it's user / roles for whether or not it displays a page or module for a user. I might need some alternatives...
  • Profiles - I am not sure how important this is as I do not know where all the profiles are used other then authentication and user management (which I already have custom modules for).

I do not intend on using DNN's default pages for user registration, user manipulation, user viewing, roles or user management of any kind...This is all custom written modules, and they work just dandily right now.

Is is even possible to seperate users from DNN completely?

I know that DNN requires an integer based ID for users, I can provide either an int based ID or a string GUID.

How do I handle roles?

How do I handle the profile?

So many questions, so little information that I can find...
I think the thing that makes this provider model stuff so difficult is the lack of end to end examples that arent mixed in with other things. And that are not centric to DNN, replacing a provider seems to be a complex task. With all of the information I am finding on DataProviders, MemberProviders and such, relating the info dump to DNN seems to be difficult for me to grasp.... A simple end to end example of replacing the providers would be very beneficial, even if it is the very basics of what is needed to accomplish this task. A list of the files needed to override / inherit / write for each provider... Simply how each file relates... A good write up on replacing the correct stuff in the web.config... I have scoured the asp.net forums and the forums here with some helpful information, but there is just so much I do not understand.

Any information would be greatly appreciated...

James

 
New Post
6/29/2006 7:27 AM
 

DNN4.3 or 3.3:

membership: inherit from and override => Dotnetnuke.Security.Membership.MembershipProvider

profile: inherit from and override => Dotnetnuke.Security.Profile.ProfileProvider

roles: inherit from and override => Dotnetnuke.Security.Roles.RoleProvider

 

Delete all originals stuff from web.config, insert your own, install DNN and all should be well

 

I wish you good luck in trying, let us know if it is as simple as it sounds  (be lucky you are not trying this in an older version)


Edit your Skin.xml and Container.xml files with:
Yannick's SXE
 
New Post
7/3/2006 3:51 PM
 

You got me started, thanks =)

I have so far been successful in creating my own Membership / Profile and Role provider...  In saying that, I have nothing special as of yet (I am still working on it!) as far as the code is concerned... I simply ripped out the DNN vb code for the providers, re-did it in C# in my own namespaces and projects.  I then changed the web.config to reflect those changes and VOILA!  It worked...

I am currently in the process of ripping out and replacing the pieces of the code that I need to customise to authenticate to my web service.  So far so good, just a little time consuming since I am trying to ensure that everything as far as data / role / profile is comming from my webservice and not DNN.  I am also busily documenting things as I go to help out others out who would like to replace these providers as well.

As to if it is as simple as it sounds... Yes actually hehe... But getting it customizd to your datastore seems to be a bit more complicated.  You have to be able to reliably map your business objects to the format that DNN is expecting, one mistake and the whole thing seems to go kablooey.  Yes, this is the second time I have pursued this... The first time was with dnn 3.x and I found the task to be beyong me at that time, as well as simply way to much work to justify at the time.  I am pleased with how things are going this time hehe...

Thanks again for the push in the right direction.  Things are becomming clearer and clearer with each line of code I write =)

 

James

 
New Post
7/3/2006 8:23 PM
 

I'm doing this as well and am having some success,

There do seem to be some errors that crop up as DNN is still hanging on to it's original user tables in some cases,

The log viewer for instance is still using the PersonalisationController which uses the DNN dataprovider and calls LoadProfile(), which then throws a foreign key constraint error because the userId does not exist in the DNN database, because the new MembershipProvider doesn't use the DNN member database.

System.Data.SqlClient.SqlException: INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_Profile_Users'. The conflict occurred in database 'DotNetNukeUpgrade', table 'Users', column 'UserID'.

Removing the foreign key constraint from the database fixes this problem.

but really the PersonalisationController should be re-written to use the ProfileProvider.

Rewriting the MembershipProviders seems to be a common thing that Developers are trying to achieve.
Is there somewhere where all issues related to re-writing the MembershipProviders should be submitted?

 

 
New Post
7/6/2006 1:03 PM
 

Hello,

I don't understand the DNN 4.3.2 web.config and membership providers.

 

In the release.config, it seems to me that there are two places where it is about membership, and I don't understand why:
First at line ~150 there is

<membership defaultProvider="..." userIsOnlineTimeWindow="15">.....

and at line ~250 there is

<members defaultProvider="...">

<providers>.....

I don't know which one has to be changed to use my custom membership provider (maybe both ?), and what do theese two options modify in dotnetnuke ?

Can anyone give me a little help and explanation about this ? I'm affraid I am a bit lost...
(I am trying to get dotnetnuke work with an existing SQL Server 2005 database)

Thanks (and sorry for language mistakes)

Christophe

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.04.3.x Replacing Membership / Profile / Role Providers...4.3.x Replacing Membership / Profile / Role Providers...


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out