MVC 5 AspNet Identity - Value cannot be null. Parameter name: source

MVC 5 AspNet Identity - Value cannot be null. Parameter name: source

By : user2950901
Date : November 17 2020, 11:58 AM
this will help Found the issue, it was in a different view(LoginPartial) than the above(Login). Data was null in the cache.
code :

Share : facebook icon twitter icon
Microsoft.AspNet.Identity Source Code Availability

Microsoft.AspNet.Identity Source Code Availability

By : Fulgham Law Firm P.C
Date : March 29 2020, 07:55 AM
wish helps you ASP.NET source codes are also on GitHub for a while, including Identity;
UserManager always null in ASPNET Identity 2 app

UserManager always null in ASPNET Identity 2 app

By : user2570245
Date : March 29 2020, 07:55 AM
To fix the issue you can do I have, after much pain, found the answer:
For some reason, the Startup file (~/App_Startup/Startup.Auth.cs), that was supposed to hold code to configure owin, did not. Not sure how this happened.
code :
public partial class Startup
        // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
        public void ConfigureAuth(IAppBuilder app)
            // Configure the db context, user manager and role manager to use a single instance per request

            // Enable the application to use a cookie to store information for the signed in user
            // and to use a cookie to temporarily store information about a user logging in with a third party login provider
            // Configure the sign in cookie
            app.UseCookieAuthentication(new CookieAuthenticationOptions
                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath = new PathString("/Account/Login"),
                Provider = new CookieAuthenticationProvider
                    // Enables the application to validate the security stamp when the user logs in.
                    // This is a security feature which is used when you change a password or add an external login to your account.  
                    OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
                        validateInterval: TimeSpan.FromMinutes(30),
                        regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))

            // Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process.
            app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5));

            // Enables the application to remember the second login verification factor such as phone or email.
            // Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from.
            // This is similar to the RememberMe option when you log in.

            // Uncomment the following lines to enable logging in with third party login providers
            //    clientId: "",
            //    clientSecret: "");

            //   consumerKey: "",
            //   consumerSecret: "");

            //   appId: "",
            //   appSecret: "");

            //    clientId: "",
            //    clientSecret: "");
Ambiguous reference issue (Microsoft.AspNet.Identity & Microsoft.AspNet.Identity.Core)

Ambiguous reference issue (Microsoft.AspNet.Identity & Microsoft.AspNet.Identity.Core)

By : Shih-Chin Yang
Date : March 29 2020, 07:55 AM
this one helps. The Microsoft.AspNet.Identity.Owin package is part of ASP.NET Identity 2, not the newest version shipped with ASP.NET 5. Trying to reference it will download ASP.NET Identity 2 and cause the weird error you're experiencing.
Just reference Microsoft.AspNet.Identity and it should work.
Why is User.Identity null after login with AspNet.Identity 3.0

Why is User.Identity null after login with AspNet.Identity 3.0

By : Callistoo
Date : March 29 2020, 07:55 AM
this will help Thank god I have found the solution after more than one day trial and error. Finally I just added the AutomaticAuthenticate-line in the Startup.cs file:
code :
app.UseCookieAuthentication(options =>
    options.AutomaticAuthenticate = true;
    options.LoginPath = new PathString("/App/Login");
AspNet Core Identity GetExternalLoginInfoAsync Always Null

AspNet Core Identity GetExternalLoginInfoAsync Always Null

By : Vedant
Date : March 29 2020, 07:55 AM
it should still fix some issue After reading my brains out, I decided to reread the IdentityServer4 documentation about external identity providers.
This caught my (tired) eye:
code :
"SignInScheme": "idsrv.external"
Related Posts Related Posts :
  • ASP.NET get cell from DataRow in a datatable?
  • how can I use a Microsoft Account to authenticate to my website
  • Unable to start debugging on the web server. Unable to connect to the webserver
  • Not able to connect to cube
  • PDF creation using itextsharp is not working in client's server
  • Date field does not display the value in Chrome browser
  • Get Text of Hyperlink which is sitting inside template field in a gridview
  • how to scale image in email body?
  • FormAuthentication not working
  • Using Entity Framework constructors in derived classes
  • Code first database not being created from model
  • Loading external DLL into WinDBG
  • Pass JSON data to strongly typed partial view in ASP.NET
  • ASP.NET MVC 4 Application w/ Areas apps suffering horrible render times
  • view sections cause problems if not rendered in layout
  • Modifying code in a website on IIS
  • Autofac and WebAPI - Default constructor error
  • RouteConfig triggers 500 error when refreshing page
  • Is it possible to change the query string value
  • MetroUI buttoon server side Click Event
  • Change default idseparator in .Net 3.5?
  • Placing DataBound Drop Down List into TableCell
  • Save the value of Dynamically created textbox
  • asp.net identity membership saving both email and username for a user
  • IIS Manager Error
  • Grid dont have data Kendo UI and AngularJS in ASP.NET MVC
  • Project stops working after installing signalr
  • While querying with linq , Max function retrieves upto '9' if more than 9 values in the list
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org