如何使用声明身份验证保护SharePoint 2013中的应用程序页面

时间:2015-05-19 19:02:50

标签: sharepoint authorization iis-7.5

我想使用声明身份验证来保护SharePoint 2013中的应用程序页面,但它似乎无法正常工作。

<configuration>
   <location path="_layouts/15/settings">
      <system.web>
         <authorization>
            <allow users="demo\user1"/>
            <deny users="*" />
         </authorization>
      </system.web>
   </location>
</configuration>

但它适用于基于Windows的身份验证。

更新:15-May-15:

我已经修好了这个

<configuration>
   <location path="_layouts/15/settings">
      <system.web>
         <authorization>
            <allow users="0#.w|demo\user1"/>
            <deny users="*" />
         </authorization>
      </system.web>
   </location>

然而,它没有授权AD小组,尝试过如下所述。

<allow users="c:0+.w|demo\group1"/>
<allow roles="c:0+.w|demo\group1"/>
<allow users="0+.w|demo\group1"/>
<allow roles="0+.w|demo\group1"/>
<allow users="demo\group1"/>
<allow roles="demo\group1"/>
<allow users="c:0+.w|sid"/>
<allow roles="c:0+.w|sid"/>
<allow users="0+.w|sid"/>
<allow roles="0+.w|sid"/>
<allow users="sid"/>
<allow roles="sid"/>

如何授权个人用户和AD群组?

更新:2015年5月22日

  <location path="_layouts/15/viewlsts.aspx">
    <system.web>
      <authorization>
        <allow users="Group1" />
        <allow users="Domain\Group1" />
        <allow users="0#.w|Domain\Group1" />
        <allow users="c:0+.w|Domain\Group1" />
        <allow users="s-1-5-21-1971354296-1767978563-xxxxxxx-yyyyyy" />
        <allow users="0+.w|s-1-5-21-1971354296-1767978563-xxxxxxx-yyyyyy" />
        <allow users="c:0+.w|s-1-5-21-1971354296-1767978563-xxxxxxx-yyyyyy" />
        <allow roles="Group1" />
        <allow roles="Domain\Group1" />
        <allow roles="0#.w|Domain\Group1" />
        <allow roles="c:0+.w|Domain\Group1" />
        <allow roles="s-1-5-21-1971354296-1767978563-xxxxxxx-yyyyyy" />
        <allow roles="0+.w|s-1-5-21-1971354296-1767978563-xxxxxxx-yyyyyy" />
        <allow roles="c:0+.w|s-1-5-21-1971354296-1767978563-xxxxxxx-yyyyyy" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>

仍然没有用。

1 个答案:

答案 0 :(得分:2)

组的前缀不同。

你尝试过吗?

#include <iostream>
#include <string>
using namespace std;

class Car{
string brand;   
public:
void setBrand(string newBrand){this->brand=newBrand;}
void Driver(){cout<<" IS DRIVING THIS CAR BRAND "<<brand<<endl;}
void Brake(){cout<<"IS BRAKING"<<endl;}
};

class Person{
private:string name;
public:
void setName(string newName){this->name=newName;}
//HERE WE CALL METHOD OF CAR CLASS AND REDEFINE METHODS NO OVERRIDE OK   
void Driver(Car objectOfClassCar){cout<<this->name<<ends;  
objectOfClassCar.Driver();}
 void Brake(string str, Car objectOfClassCar){cout<<this->name<<"  
"<<str<<ends;objectOfClassCar.Brake();}
  };

  int main(){
  Car corolla;
  corolla.setBrand("TOYOTA");   
  Person student;
  student.setName("MIGUEL");
  student.Driver(corolla);
  student.Brake("CAR",corolla);
  //it open a lot of opportunities to do the same.
  }

如果有效,您可以像这样授权组和用户

<allow users="c:0+.w|demo\group1"/>