locked
User.Identity.Name ?(EMPTY) RRS feed

  • Question

  • User-305496339 posted

    Hi Friends !!!! I am working on an asp.net web forms website. I am running this test website in visual studio IDE no IIS because I am developing/testing. However. I need help with why I am not able to get the User.Identity.Name. Thanks !!!

    Wednesday, June 12, 2019 7:11 PM

Answers

  • User475983607 posted

    rkrex

    windows authentication 

    Did you select "Windows Authentication" as the authentication scheme when you created the project?  

    If not, add the highlighted following  configuration to the web.config.

      <system.web>
        <compilation debug="true" targetFramework="4.7.2" />
        <httpRuntime targetFramework="4.7.2" />
        <authentication mode="Windows"/>
        <authorization>
          <deny users="?"/>
        </authorization>

    Then click on the project in the Solution Explorer.  In the properties window, disable Anonymous Authentication and Enable Windows Authentication. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 12, 2019 8:23 PM

All replies

  • User475983607 posted

    What authentication scheme are you using?

    Wednesday, June 12, 2019 7:22 PM
  • User-305496339 posted

    windows authentication 

    Wednesday, June 12, 2019 7:30 PM
  • User475983607 posted

    rkrex

    windows authentication 

    Did you select "Windows Authentication" as the authentication scheme when you created the project?  

    If not, add the highlighted following  configuration to the web.config.

      <system.web>
        <compilation debug="true" targetFramework="4.7.2" />
        <httpRuntime targetFramework="4.7.2" />
        <authentication mode="Windows"/>
        <authorization>
          <deny users="?"/>
        </authorization>

    Then click on the project in the Solution Explorer.  In the properties window, disable Anonymous Authentication and Enable Windows Authentication. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 12, 2019 8:23 PM