如何验证用户是否经过身份验证 [英] How to validate user is authenticated or not

查看:85
本文介绍了如何验证用户是否经过身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户在浏览器中点击URL时验证用户是否经过身份验证。

例如。

http:// localhost:52466 / AdminWebsite / result。 pdf

如果用户经过身份验证,那么他应该能够下载pdf文件,如果没有重定向到登录页面

解决方案

使用密钥/标志来设置用户登录并在访问URL时使用密钥。或者在用户登录时保持会话并检查会话是否具有该值。



问候,

Hsakarp


您可以使用Asp.Net的FormAuthentication。



这是对用户进行身份验证的最简单方法。





--- Chetan Patel

我当然不是你可以在查询字符串中为经过身份验证的用户传递一些独特的价值

点击按钮



并检查页面加载时查询字符串的值

How to validate user is authenticated or not whenever he hit URL in the browser.
eg.
"http://localhost:52466/AdminWebsite/result.pdf"
if the user is authenticated then he should able to download the pdf file , if not redirect to Login page

解决方案

While logging in use a key/flag to set the user logged in and use the key whenever he access the URL.or keep a session while user log in and check whether the session has the value or not.

Regards,
Hsakarp


You may use FormAuthentication of Asp.Net.

It is the easiest way to authenticate the user.


---Chetan Patel


I am not Sure but you can pass some unique value for authenticated user in query string
while click button

and check the value of query string when page is load


这篇关于如何验证用户是否经过身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆