Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Azure AD login when password reset is disabled #6323

Open
2 tasks done
iiminov opened this issue Jan 29, 2025 · 2 comments
Open
2 tasks done

[Bug]: Azure AD login when password reset is disabled #6323

iiminov opened this issue Jan 29, 2025 · 2 comments

Comments

@iiminov
Copy link

iiminov commented Jan 29, 2025

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Users cannot log in via Azure AD when Reset Password is disabled in web config file.

This happens on new install of DNN 9.13.2

Steps to reproduce?

  1. Configure Azure AD
  2. Verify user can sign in using Azure provider
  3. Set enablePasswordReset="false" in web config file
  4. Verify user unable to sign in using Azure provider

Current Behavior

After user successfully authenticates with Azure credentials they get redirected to Login page with the following message:

An email with your details has been sent to the Site Administrator for verification. You will be notified when your registration has been approved. In the meantime you can continue to browse this site.

Expected Behavior

After user successfully authenticates with Azure credentials they get redirected to Login page and get logged in.

Relevant log output

2025-01-29 06:55:05.656+00:00 [WebSvr01][D:2][T:10][ERROR] DotNetNuke.Authentication.Azure.Components.AadController - Error while login in: This provider is not configured to allow password resets. To enable password reset, set enablePasswordReset to "true" in the configuration file.
2025-01-29 06:55:05.671+00:00 [WebSvr01][D:2][T:10][ERROR] DotNetNuke.Authentication.Azure.Components.AzureClient - Error validating token
System.ArgumentNullException: Value cannot be null.
Parameter name: value
   at System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic, CacheInternal cache)
   at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace)
   at System.Web.Caching.AspNetCache.Insert(String key, Object item, CacheInsertOptions options)
   at System.Web.Caching.Cache.Insert(String key, Object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback)
   at DotNetNuke.Services.Cache.FBCachingProvider.Insert(String cacheKey, Object itemToCache, DNNCacheDependency dependency, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback)
   at DotNetNuke.Services.Cache.CachingProvider.Insert(String cacheKey, Object itemToCache, DNNCacheDependency dependency, DateTime absoluteExpiration, TimeSpan slidingExpiration)
   at DotNetNuke.Authentication.Azure.Components.AadController.ValidateAuthorizationValue(String authorization)
   at DotNetNuke.Authentication.Azure.Components.AzureClient.LoadTokenInternal(String token, Boolean verifyToken)
2025-01-29 06:56:21.037+00:00 [WebSvr01][D:2][T:10][ERROR] DotNetNuke.Authentication.Azure.Components.AadController - Error while login in: This provider is not configured to allow password resets. To enable password reset, set enablePasswordReset to "true" in the configuration file.
2025-01-29 06:56:21.037+00:00 [WebSvr01][D:2][T:10][ERROR] DotNetNuke.Authentication.Azure.Components.AzureClient - Error validating token
System.ArgumentNullException: Value cannot be null.
Parameter name: value
   at System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic, CacheInternal cache)
   at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace)
   at System.Web.Caching.AspNetCache.Insert(String key, Object item, CacheInsertOptions options)
   at System.Web.Caching.Cache.Insert(String key, Object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback)
   at DotNetNuke.Services.Cache.FBCachingProvider.Insert(String cacheKey, Object itemToCache, DNNCacheDependency dependency, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback)
   at DotNetNuke.Services.Cache.CachingProvider.Insert(String cacheKey, Object itemToCache, DNNCacheDependency dependency, DateTime absoluteExpiration, TimeSpan slidingExpiration)
   at DotNetNuke.Authentication.Azure.Components.AadController.ValidateAuthorizationValue(String authorization)
   at DotNetNuke.Authentication.Azure.Components.AzureClient.LoadTokenInternal(String token, Boolean verifyToken)
2025-01-29 06:59:15.929+00:00 [WebSvr01][D:2][T:24][ERROR] DotNetNuke.Data.PetaPoco.PetaPocoHelper - [3] Error executing SQL: DECLARE @OS VARCHAR(1000)
EXECUTE xp_regread 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'ProductName', @OS OUTPUT
SELECT 1
xp_regread() returned error 5, 'Access is denied.'
2025-01-29 06:59:15.929+00:00 [WebSvr01][D:2][T:24][ERROR] DotNetNuke.Data.SqlDataProvider - System.Data.SqlClient.SqlException (0x80131904): xp_regread() returned error 5, 'Access is denied.'
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at DotNetNuke.Data.PetaPoco.PetaPocoExt.ExecuteReader(Database database, String sql, Object[] args)
   at DotNetNuke.Data.PetaPoco.PetaPocoHelper.ExecuteReader(String connectionString, CommandType type, Int32 timeoutSec, String sql, Object[] args)
   at DotNetNuke.Data.SqlDataProvider.ExecuteSQLInternal(String connectionString, String sql, Int32 timeoutSec, String& errorMessage)
ClientConnectionId:9b4cdcd0-6694-4381-a7c3-2903271c4ca5
Error Number:22001,State:1,Class:16

Anything else?

No response

Affected Versions

9.13.6 (latest release)

What browsers are you seeing the problem on?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@davidjrh
Copy link
Contributor

davidjrh commented Mar 3, 2025

Hi @iiminov, based on the logs provided, it seems to be an issue with the DNN Azure AD provider available at https://github.com/davidjrh/dnn.azureadprovider and not from the DNN Platform itself. Is that correct?

Can you open the issue on the provider repo https://github.com/davidjrh/dnn.azureadprovider/issues so we can track this better.

PS: since the provider doesn't support password resets (are managed in the Azure AD), would like to know more about your scenario.

@iiminov
Copy link
Author

iiminov commented Mar 3, 2025

Posted under dnn.azureadprovider #113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants