DNNCommunity / DNN.ActiveDirectory

Active Directory authentication for DNN
MIT License
26 stars 22 forks source link

Cannot login - error when creating DNN user? #75

Open roman-yagodin opened 4 years ago

roman-yagodin commented 4 years ago

Describe the bug

It seems like AD provider successfully connects to AD, gets user information, but fails to create user in DNN. My wild guess - due to random password doesn't match the required parameters?

Software Versions

To Reproduce

Steps to reproduce the behavior:

  1. Install and configure the AD provider
  2. Enable it via site extensions
  3. Try to login with existing AD account credentials

Error log

Log entries with Debug mode enabled:

  1. Description:@GETUSER:Getting ready to getUserEntryByName. LoggedOnUserName: DOMAIN\test_user
  2. Description:@GETUSER:Successfully retrieved user entry by name. Username: DOMAIN\test_user ...
  3. Login Failure
  4. Description:@CREATEUSER:Dumping create status: CreateStatus: InvalidPassword
  5. Description:@GETUSER:Successfully filled objAuthUser object. objAuthUser object JSON: ...

Additional context

From web.config:

<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SiteSqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
requiresUniqueEmail="false"
passwordFormat="Hashed"
applicationName="DotNetNuke"
description="Stores and retrieves membership data from the local Microsoft SQL Server database" />
sawest commented 3 years ago

I have confirmed that the random password created in this module is all numeric. Requiring non alpha characters will trigger an issue. Random password code should be refactored to add upper and lower case letters in case these are required.

roman-yagodin commented 3 years ago

Can the DNN UserContoller.GeneratePassword() be used for this?

sawest commented 3 years ago

That is a great idea. I will look and see if it can be.