Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何仅对某些页面使用sso_C#_Asp.net_Single Sign On - Fatal编程技术网

C# 如何仅对某些页面使用sso

C# 如何仅对某些页面使用sso,c#,asp.net,single-sign-on,C#,Asp.net,Single Sign On,我有一个web应用程序。在使用sso进行身份验证之前。我将下面显示的代码放在web.config页面中 <authentication mode="Forms"> <forms loginUrl="https://sso.***.***.***/login" timeout="30" defaultUrl="~/Index.aspx" cookieless="UseCookies" slidingExpiration="true" path="/" />

我有一个web应用程序。在使用sso进行身份验证之前。我将下面显示的代码放在web.config页面中

<authentication mode="Forms">
      <forms loginUrl="https://sso.***.***.***/login" timeout="30" defaultUrl="~/Index.aspx" cookieless="UseCookies" slidingExpiration="true" path="/" />
    </authentication>

它工作得很好。每个人去那个网站都需要先登录。 现在我们需要改变,使一些网页向公众开放。所以人们不需要登录就可以访问某些页面,但某些页面仍然需要登录(使用sso)。 怎么做

谢谢

使用web.config的
部分。如果当前要求用户登录所有页面,我假设您有以下情况:

<authorization>
    <deny users="?">
</authorization>

您可以添加
元素(这些元素位于
部分之外):


您可以添加任意数量的
元素,还可以在path属性中以目录为目标


如果您想使目录的内容更整洁,可以将web.config添加到目录中,并将
元素添加到该web.config

。页面底部有一个指向location元素的链接。嘿,Jason,你救了我一天!
  <location path="publicpage.aspx">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>