question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MongoIdentityOptions missing Passord configuration

See original GitHub issue

After updating to newest version I cannot use Password options in MongoDbProvider configuratioin

services.AddIdentityMongoDbProvider<ApplicationUser>(options => { options.ConnectionString = connectionString; options.Password.RequiredLength = 6; options.Password.RequireLowercase = true; options.Password.RequireUppercase = true; options.Password.RequireNonAlphanumeric = true; options.Password.RequireDigit = true; });

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
7Kronoscommented, Nov 14, 2018

@Maciejszuchta You have to specify both delegates to access identity options. Copy paste my code should work.

2reactions
7Kronoscommented, Nov 14, 2018

I’m not sure what you mean. This works fine with last aspnet core version (2.1.1).

You have to use this signature if you want to have access to both MongoIdentityOptions and IdentityOptions.

IServiceCollection AddIdentityMongoDbProvider<TUser, TRole>(this IServiceCollection services,
			Action<IdentityOptions> setupIdentityAction, Action<MongoIdentityOptions> setupDatabaseAction)

Try this :

                services.AddIdentityMongoDbProvider<ApplicationUser, MongoRole>(identityOptions =>
                {
                    identityOptions.Password.RequiredLength = 6;
                    identityOptions.Password.RequireLowercase = true;
                    identityOptions.Password.RequireUppercase = true;
                    identityOptions.Password.RequireNonAlphanumeric = true;
                    identityOptions.Password.RequireDigit = true;
                }, options =>
                {
                    options.ConnectionString = connectionString;
                });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using ASP.NET Core Identity with MongoDB
'MongoIdentityOptions' does not contain a definition for 'Password' and no accessible extension method 'Password' accepting a first argument of ...
Read more >
How to connect using user id and password - Ops and Admin
Hi, We do have environment in mongoDB 4.2 ,redhad 7 . As per the user request as a admin we have created the...
Read more >
Change Your Password and Custom Data
Overview. Users with appropriate privileges can change their own passwords and custom data. Custom data stores optional user information.
Read more >
Configure ASP.NET Core Identity
In this article. Identity options; Password Hasher options; Globally require all users to be authenticated; ISecurityStampValidator and SignOut ...
Read more >
Modify the default MongoDB root password
Modify the MongoDB root password. You can modify the MongoDB password using the following command at the shell prompt: mongo admin --username root ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found