New ASP.Net project but asking to sign in - asp.net-mvc

I created a new ASP.net core project using VS2019. I did not modify anything from the automatically created weatherforecast controller. My problem is, everytime I just try to debug, the browser pops up asking me to sign in. Is there a default user and password created? How to solve this?

It is probably you are using Windows Authentication while create your Asp.NET project, try uncheck Authentication it will allow getting into the landing page of your application

Make sure that during the creation of the project you didn't add authentication. There's an option to add authentication by default.

Related

Not able to access my MVC 5 web application after adding MS Identity

I created my app using a template. After that i managed to connect it with an existing database. Then i tried to add Identity so that i will be able to authorise and authenticate users of the application. I tried to do that following the instructions of "shyamal parikh" in this post Adding ASP.NET MVC5 Identity Authentication to an existing project
My problem is that now i get a 401 error unless i got to solution explorer (in VS) and disable the windows authentication. But when i do that all the users have unrestricted access to the whole application.
I assume that the problem has to do with that solution that i performed but i cant comment directly there.
Can anyone give me a hint as to what i might be doing wrong?
Do you have windows authentication installed on your computer? Maybe adding that might help. Here are the instructions-
https://www.iis.net/configreference/system.webserver/security/authentication/windowsauthentication/providers/add
Also look at your event viewer, you might have some hints there.

Active Directory authentication with initial page open (mvc 4)

I want first page available to everyone and through form (no popup) and Active Directory authentication.
Everything is fine if I use Windows authentication but as I said I don't want popup and I do want first page aviable and with login form fields. Is this possible? If so how to achieve that?
Yes it is possible. You can setup your login controller's login function with [AllowAnonymous] which will make it visible to user even if user is not logged in and rest of the controllers you can specify [Authorize] ... Infect if you create a new template project with type of project as Intranet which will automatically setup your project with windows authentication.

Why member can't sign in when migrate membership database from ASP.NET MVC3 to MVC4

I manually migrate data from ASP.NET membership database to new membership structure in ASP.NET MVC4. (table name has changed from aspnet_users to Users, aspnet_membership to Memberships, and so forth)
But when try to sign in using ASP.NET MVC4 sign in dialog, it can't signed in.
So I wonder that if default hash algorithm changed in MVC4 or not.
Why member can't sign in?
or How can I set the hash algorithm to Sha1?
or How to migrate membership database to MVC4 correctly?
Hash algorithm is not related to ASP.NET MVC binaries. It is highly likely that you misconfigured something.
On solution explorer inside VS, click on your project and there should be an icon (with a world and hammer side by side [it is scary I know] I guess) just top of your solution as follows :
Click on it to fire up the configuration manager. See if you can configure your membership data there. If not, it is sure that you misconfigured something.
UPDATE :
Please also be sure that you have configured the passwordFormat inside the web.config correctly. It should be same as your old one.
If your passwordFormat has been set to Encrypted on your old app, then you should use the same machine key which you have used to create passwords before.
MVC4DP using Universal providers. How about checking configuration or Databases.

Default login asp.net MVC3

Where is the login information (username, password) actually stored by using the default template from ASP.NET MVC application in VS2010? I mean, is it physically registered in a database, file or something else?
Upon registering the first user a database named ASPNETDB.MDF under the application’s
App_Data directory is created. This information was supplied by default in the root web.config file.
There is no default login. There is not even a database created when you start a new project. You need to register a new user by clicking on the Register link on the login page. When you register a new user you will be prompted to specify the username and password and a database file will be created in the App_Data folder. Now you can go ahead and login with the account you have just created. And by the way the same stands true for ASP.NET MVC 1.0 and 2.0 project templates.
If you can't see the database under App_data, try clicking "Show all Files" which is one of the icons at the top of the solutions explorer. Then the database will show under App_data as something like ASPNETD8.MDF.

How to edit the user details stored in aspnetdb without asp.net web administration tool?

I have asp.net MVC application which uses asp.net membership. I configured the user details from local system using Asp.Net web site administration tool. Now I have deployed the site in server and I need to change the password. Now I have the ASPNETDB.MDF file in the App_Data folder.
How to edit the details?
Adding ASP.Net MVC Membership Starter Kit to your project is a great place to start, if you see ongoing edits being required.
You could do one of a couple of things. You can copy the MDF from the site to the local machine, and then change the details there, then copy the MDF back over, or you can implement a web page that changes the password using the SqlMembershipProvider.ChangePassword method.
You must call the method MembershipProvider.ChangePassword. See http://msdn.microsoft.com/en-us/library/system.web.security.membershipprovider.changepassword.aspx.

Resources