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

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Inserting Users from 3rd party databaseInserting Users from 3rd party database
Previous
 
Next
New Post
4/3/2015 1:35 AM
 

Currently I’m developing DNN scheduler application which inserting users and user roles from 3rd party database.

As part of the requirements, the main login screen for the DNN portal should authenticate the user with Google Authentication provider.

I see there are lots of tables which authenticating users in DNN. Ex. Users, UserRoles, UserPortals and aspnet_Membership, aspnet_Users, UserAuthentication.

So, can you please give me steps to insert data on those tables one by one to fulfil my requirement?


- Keval
 
New Post
4/3/2015 1:59 AM
 

Keval,

there are articles about creating authentication providers, either in the blogs or wiki on this page, or all over the web. Use Google to get some push in the right direction.

If you only would like to import the users (and not an authentication provider), you should write a  little module that reads the user data from the external database and creates them in DNN using the public API. The framework will push the data in the correct table then.

E.g.

         DotNetNuke.Entities.Users.UserInfo user = new DotNetNuke.Entities.Users.UserInfo();
         user.Username = "Michael";
         user.FirstName = "Michael";
         user.LastName = "Tobisch";
         user.DisplayName = "Michael Tobisch";
         user.Email = "michael.tobisch@some.where";
         DotNetNuke.Entities.Users.UserController.CreateUser(ref user);
         DotNetNuke.Entities.Users.UserController.GeneratePassword();

or something alike. Please refer to code that works, this is just to give you some idea.

The aspnet_* tables are used by the ASP.Net Membership provider, which is the default authentication provider in DNN.

The "Users" table holds different user information, such as first and last name, email address, username etc.

The "UserRoles" table hold information about the roles a user is member of (RoleId refers to the field in the "Roles" table, so basically this is used to resolve an m:n relationship between these two tables).

The "UserPortals" table holds information about the portals a user is registered in (PortalId refers to the field in the "Portals" table, again to resolve an m:n relationship).

Happy DNNing!
Michael


Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
 
New Post
4/3/2015 5:15 AM
 
A word of warning. The tables and table structures in the DNN database are NOT considered to be a stable API. Any future release of the product might change or remove those structures.

It is safer to use methods from the DNN API.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Inserting Users from 3rd party databaseInserting Users from 3rd party database


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