简体   繁体   English

如何在asp.net中设置表单身份验证

[英]how to set Form authentication in asp.net

I am aware of how to configure windows authentication using asp.net My requirement is as soon as the web page loads it should redirect to login page and in login page i need to enter windows credentials then it should validate using windows authentication method and redirect me to original page.我知道如何使用 asp.net 配置 Windows 身份验证我的要求是,一旦网页加载它应该重定向到登录页面,在登录页面中我需要输入 Windows 凭据然后它应该使用 Windows 身份验证方法进行验证并重定向我到原始页面。 Can anyone help me how to do it?谁能帮我怎么做?

in web.config add the following lines of code在 web.config 中添加以下代码行

    <system.web>
    <authentication mode="Forms">
    <forms defaultUrl="indexpagename.aspx" loginUrl="Login.aspx" slidingExpiration="true" timeout="2880"></forms>
    </authentication>
    </system.web>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM