Using windows authentication in asp.net with c#

前端 未结 1 1535
Happy的楠姐
Happy的楠姐 2021-01-18 17:56

Im trying to understand how windows authentication works and how to implement it. Ive read quite a few articles and watched some quite length videos on youtube but i still c

1条回答
  •  一生所求
    2021-01-18 18:23

    You are confusing SQL authentication with Windows authentication.

    In order for this web page to work based on Windows authentication, your web.config needs

    
    

    When you deploy your page to a web server, you need to disable anonymous authentication to restrict external users. Below is a snippet from an IIS7+ web server's authentication section:

    enter image description here

    enter image description here

    If you need to program against logged in user or its group, you need to use the WindowsIdentity Class.

    0 讨论(0)
提交回复
热议问题