登录到主页上的页面后(如果我复制URL) [英] after login to my page in home page if i copy URL

查看:162
本文介绍了登录到主页上的页面后(如果我复制URL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,


我们正在使用Web应用程序.对于身份验证和捕获IP地址,我们有一个Windows窗体.基于成功身份验证的检查将使用查询字符串重定向到IE.
但我有一个问题.如果我复制URL,则登录后的主页.当我将URL粘贴到新的浏览器上时,它将打开而未进行身份验证.

任何解决此问题的建议.


谢谢
karthik

Hello friends,


we are using web application . for that for authentication and capturing IP address we have a windows form. based on success authentication check am redirecting to IE with query string.
but i have a problem. the Home page after login if i copy the URL . and when i paste the URL on new browser it opening with out authentication.

any suggestions to resolve the issue.


thanks
karthik

推荐答案

您是否设置了允许和拒绝规则?

您需要通知系统,要求用户登录后才能查看某些页面.
而且您还可以说某些页面或某些文件夹中的所有页面都要求用户担任某些角色.
您可以使用web.config中的allow和deny
完成此操作 如果页面在不同的文件夹中,则每个文件夹中都可以包含一个小的web.config,该Web.config给出了该文件夹中页面的规则.

例如,这是一个web.config文件,其中:
允许具有管理员角色的用户.允许角色=管理员"
禁止所有其他用户-拒绝用户="*"
这适用于该文件夹中的所有页面.
Have you set up allow and deny rules?

You need to inform the system that you require users to be logged in, before they can look at certain pages.
And you can also say that some pages, or all the pages in certain folders, require users to be in certain roles.
You do this with allow and deny in web.config
If you have pages in different folders, you can have a little web.config in each folder that gives the rules for the pages in that folder.

For example, here is a web.config file where:
Users with adminstrator role are allowed. allow roles="administrator"
All other users are banned - deny users="*"
This applies to all pages in that folder.
<configuration>
  <system.web> 
    <authorization>
      <allow roles="administrator, developer" /> 
      <deny users="*" />
    </authorization> 
  </system.web>
</configuration>


有关更多信息,请参见:在新的浏览器窗口中复制url粘贴应使我进入登录页面
[ ^ ]


For more information look at: Copy paste of url in new browser window should take me to Login Page
[^]


引用:
成员资格简介 [
Refer:
Introduction to Membership[^]
and set appropriate access to users in your web.config.
<configuration>
    <system.web>
        <authorization>
            <allow roles="Admin" />
            <allow roles="User" />
            <deny users="*" />
        </authorization>
    </system.web>
</configuration>



也有类似的讨论:
如何防止URL输入并将用户重定向到登录页面 [如何将用户重定向到ASP.未授权时的NET页面 [



Also have look on similar discussion:
How do I prevent URL entry and redirect the user to login page[^]
How to Redirect Users to an ASP.NET page when not Authorized[^]


如果您使用的是ASP.NET应用程序,请使用web.config,角色和成员资格API来实现这个.您可能会发现这些链接很有帮助.

了解ASP.NET角色和成员资格-入门教程 [ ^ ]
了解并实现ASP.NET自定义表单身份验证 [ ^ ]

如果我的理解不正确,请告诉我,我将尝试完善答案.
If you are using the ASP.NET application then use web.config, roles and membership APIs to achieve this. you might find these links helpful.

Understanding ASP.NET Roles and Membership - A Beginner''s Tutorial[^]
Understanding and Implementing ASP.NET Custom Forms Authentication[^]

Let me know if my understanding is not correct and I will try to refine my answer.


这篇关于登录到主页上的页面后(如果我复制URL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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