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

Extend membership provider configuration properties #101

Closed
osigas opened this issue Aug 1, 2019 · 2 comments
Closed

Extend membership provider configuration properties #101

osigas opened this issue Aug 1, 2019 · 2 comments

Comments

@osigas
Copy link
Contributor

osigas commented Aug 1, 2019

Rather than having to implement a custom version of UmbracoMembersUserManager for each build, it would be a time saver to be able to have some more configuration properties to control the basic features of the UserValidator and the PasswordValidator assigned to the UserManager.

e.g. from the web.config
<add name="UmbracoMembershipProvider" type="UmbracoIdentity.IdentityEnabledMembersMembershipProvider" passwordRequiresDigit="true" passwordRequiresLowercase="true" passwordRequiresUppercase="true" minRequiredNonalphanumericCharacters="1" minRequiredPasswordLength="10" ... />

These would pass through to the UmbracoMembersUserManager:
manager.PasswordValidator = new PasswordValidator { RequiredLength = provider.MinRequiredPasswordLength, RequireNonLetterOrDigit = provider.MinRequiredNonAlphanumericCharacters > 0, RequireDigit = provider.PasswordRequiresDigit, RequireLowercase = provider.PasswordRequiresLowercase, RequireUppercase = provider.PasswordRequiresUppercase };

@osigas
Copy link
Contributor Author

osigas commented Aug 1, 2019

PR in #102 where I had a stab at doing it myself.

@Shazwazza
Copy link
Owner

Just testing this and may have to tweak a few things since this will essentially mean 'breaking changes'

  • The cookie name will change from the default .AspNet.ApplicationCookie to securitySection.AuthCookieName + "_MEMBERS"
  • Any configuration that is applied to the membership provider will now be applied to the user manager - which is good but might be a surprise to some

I think this is just a documentation thing so all good. I'll add to the release notes.

Thanks!!

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