1
Guys I have a question: how do I get the user logged into windows on the client machine? It’s getting the server user and not the client machine. Could you help me?
1
Guys I have a question: how do I get the user logged into windows on the client machine? It’s getting the server user and not the client machine. Could you help me?
2
When creating the project, Visual Studio offers this option.
When creating a project, click Change Authentication as in the screen below:
On the next screen, click Windows Authentication:
If the project already exists, modify the following in your web.config
:
<configuration>
...
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
</system.web>
...
</configuration>
The user name will be both in Controllers how much in Views, inside User.Identity.Name
.
Browser other questions tagged asp.net-mvc authentication
You are not signed in. Login or sign up in order to post.
Is it not necessary to make any changes in iis? , the application being started returns me a 404 error, asking for a login.aspx pages I do not have this file in my project, where I could redirect to go straight where I wish?
– Jeff Silva
@Jeffsilva Well, if you set up the project for Windows authentication, it doesn’t make sense to have login screen. Is there any internal permissions control within your system?
– Leonel Sanches da Silva
I already solved this problem, it was a redirect badly pasted, I put the correct redirect, but the following error arises: "Unauthorized: Logon failed due to server Configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the Authentication methods enabled on the Web server. Contact the Web server’s Administrator for Additional Assistance." I believe it is about the directory where the project is, but it is located locally on my machine and I am administrator, so what is the reason for this error?
– Jeff Silva
It has already been solved, I needed to change windows authentication in iis to enable and give authorization to the group of users in directory, thanks gypsy!
– Jeff Silva