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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationSpecific DotNetNuke Api to use to authenticate usersSpecific DotNetNuke Api to use to authenticate users
Previous
 
Next
New Post
4/17/2009 11:53 AM
 

Hi,

The company i work for has asked me to write a Winform application. Their users are currently using the DotNetNuke to access the company portal. The Winform app will be used by other users but it will have different function that the portal provides. They want the users to be authenticated so they have asked me to use the same method as used for the portal for authenticating users. The portal uses DotNetNuke to do the authentication. I am not familiar with DotNetNuke enough to know which API's i need to use. I only will have a username and password and have found the DotNetNuke.dll and added it as a reference in my VS2008 project. I need help identifying the specific API (s) i need to use. Any help will be appreciated. (P.S. I hope i have targeted the write forum for this question.)

thank you,

bramoin 

 
New Post
4/20/2009 2:22 PM
 

Ok, i saw no replies, so i got bussy and looked through the code, looks like i can use ValidateUser but the problem is that this DLL by itself will not do it. There is something else needed, like configuration file. I really don't know what else is needed because typically, this is used in the context of the web site, i.e. the user goes to a web site and DNN already knows somethings like the IP of the user, and since the some installed DNN, it is also setup to work. So, what is the logic it follows and what is the minimum configuration information it needs to run?

thanks,

bramoin

 
New Post
4/20/2009 3:28 PM
 

Sorry Bramoin. I was going to reply to your post but I've got to hunt down what I think you'll need as well. I guess the best I can suggest at this point is to install the source code and step through the login process to see what info needs to get passed.

 
New Post
4/21/2009 3:34 PM
 

Hi,

I found out that i need to use these API:

DotNetNuke.Security.Membership.

UserLoginStatus loginStatus = UserLoginStatus.LOGIN_FAILURE;IPAddress localIPAddress = NetworkInterface.GetAllNetworkInterfaces()[0].GetIPProperties().UnicastAddresses[0].Address;UserInfo objUser = UserController.ValidateUser(1, username, password, "DNN", "", "Operations", localIPAddress.ToString(), ref loginStatus);

Now, the problem is that when it tries to run the ValidateUser an exception take places: Here are the details: (with InnerExceptions)

{"The type initializer for 'DotNetNuke.Entities.Users.UserController' threw an exception."}

{"The type initializer for 'DotNetNuke.Security.Membership.MembershipProvider' threw an exception."}

{"The type initializer for 'DotNetNuke.Services.Cache.CachingProvider' threw an exception."}

{"Value cannot be null.\r\nParameter name: type"}

I think it may be that i don't have either a reference dll or a configuration but i don't know, so here is the provider section of my configuration:

<

<

<

<

<

</

</

membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15">providers>clear />add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SiteSqlServer" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" requiresUniqueEmail="false" passwordformat="Encrypted" applicationName="DotNetNuke" description="Stores and retrieves membership data from the local Microsoft SQL Server database" />add name="DNNSQLMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SiteSqlServer" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" requiresUniqueEmail="false" passwordformat="Encrypted" applicationName="DotNetNuke" description="Stores and retrieves membership data from the local Microsoft SQL Server database" />providers>membership>

Any help is appreciated.

thanks,

bramoin

 

 

 

 
New Post
4/21/2009 5:45 PM
 

Hi Bramoin,

DotNetNuke layers an additional level of indirection on top of the ASP.NET membership system.  This is necessary due to the fact that DotNetNuke multiplexes its users across portals (e.g. a user on one portal does not automatically have access to other portals).  [As an aside, for those familiar with the ASP.NET membership system, one would immediately wonder why portal-specific application names weren't used.  This was to simplify the host user implementation, because a host has access across portals.]

So, to access the DotNetNuke membership information, you would also need the dotnetnuke/membership provider element in your .config file, along with the (assuming defaults) DotNetNuke.Membership.AspNetMembershipProvider.dll deployed in your application's bin directory.

Note that if you do NOT need DotNetNuke portal identification, you can bypass the DotNetNuke membership system and go directly to the ASP.NET membership (sub)system.  To do this, use the System.Web.Security.Membership class.  Note that if you go this route, you will not have access to a user's portalIds (handled at the higher layer), and users that you create will not initially be associated with any portals.

I know this is all a bit confusing.  Let me know if anything requires additional clarification, or if you need more help.  Best of luck!

Brandon


Brandon Haynes
BrandonHaynes.org
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationSpecific DotNetNuke Api to use to authenticate usersSpecific DotNetNuke Api to use to authenticate users


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