aspnet-identity-mongo | mongodb provider for the new ASP | Identity Management library

 by   g0t4 C# Version: Current License: MIT

kandi X-RAY | aspnet-identity-mongo Summary

kandi X-RAY | aspnet-identity-mongo Summary

aspnet-identity-mongo is a C# library typically used in Security, Identity Management applications. aspnet-identity-mongo has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

This is a MongoDB provider for the ASP.NET Core Identity framework. This was ported from the v2 Identity framework that was a part of ASP.NET (AspNet.Identity.Mongo NuGet package).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              aspnet-identity-mongo has a low active ecosystem.
              It has 195 star(s) with 133 fork(s). There are 46 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 11 open issues and 22 have been closed. On average issues are closed in 24 days. There are 4 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of aspnet-identity-mongo is current.

            kandi-Quality Quality

              aspnet-identity-mongo has 0 bugs and 0 code smells.

            kandi-Security Security

              aspnet-identity-mongo has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              aspnet-identity-mongo code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              aspnet-identity-mongo is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              aspnet-identity-mongo releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of aspnet-identity-mongo
            Get all kandi verified functions for this library.

            aspnet-identity-mongo Key Features

            No Key Features are available at this moment for aspnet-identity-mongo.

            aspnet-identity-mongo Examples and Code Snippets

            No Code Snippets are available at this moment for aspnet-identity-mongo.

            Community Discussions

            Trending Discussions on aspnet-identity-mongo

            QUESTION

            Architecture and ASP.Net Identity
            Asked 2017-Aug-04 at 16:12

            Im currently following the following GitHub for guidance on storing user data from ASP.Net Identity into Mongo: https://github.com/g0t4/aspnet-identity-mongo . With a basic proof of concept, I have been able to successfully store user data. The current issue that I am facing is my application requires two types of users (both will be stored to the same Mongo collection).

            For simplicity, we can call the users A and B. Both A and B are setup as models and have their own properties. My initial idea was to setup both A and B as derived classes of ApplicationUser (see the IdentityModels.cs file in the referenced repo).

            Registration into my application worked perfectly with this architecture and JSON documents were posted/stored into my MongoDB. The issue is when I try to login. Upon posting, I get the server error:

            Element does not match any field or property of class Models.ApplicationUser

            The error goes away when I put all of model A's elements into ApplicationUser; however, this leaves the issue of model B not being accounted for. As such, I wanted to ask what the best path would be for me to take with this? Some ideas I was batting around involved creating two unique UserManagers, using one large JSON document with all elements (seems kinda unorganized), or perhaps using one UserManager with an adapter for the two models?

            ...

            ANSWER

            Answered 2017-Aug-04 at 16:12

            The way you've set this up is fine, and the way it should be. The problem seems to be in how Mongo handles the inheritance, although you'd still have a different but equally problematic issue with something like SQL Server.

            In short, what seems to be happening here is that you're essentially upcasting UserA/UserB to ApplicationUser, but since the JSON includes properties from those derived classes, which ApplicationUser doesn't, Mongo is choking on it. The solution is to use multiple UserManagers. It's a generic type that takes a TUser type param. The default implementation is UserManager, but that assumes everything is an ApplicationUser. If you have derived user types, then you need to use type-specific UserManager instances for those, i.e. UserManager and UserManager.

            FWIW, the problem you'd experience with another data store is that the type that is saved is what determines the value of the Discriminator column added to instantiate the right type with queries. Even if you're creating UserA, for example, if you use an instance of UserManager, it will be upcast to ApplicationUser and saved as ApplicationUser, not UserA. This is similar to what's happening in your Mongo setup, but something like SQL Server would accept it happily (although your data would then be messed up), whereas Mongo is erroring out.

            Long and short, always use a UserManager instance that's specific to the user type you're working with.

            Source https://stackoverflow.com/questions/45510881

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install aspnet-identity-mongo

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/g0t4/aspnet-identity-mongo.git

          • CLI

            gh repo clone g0t4/aspnet-identity-mongo

          • sshUrl

            git@github.com:g0t4/aspnet-identity-mongo.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link