Shibboleth 2.0安装指南(Linux版)
IdP的安装大致可分为网络平台的安装和Shibboleth IdP的安装两个部分。其中网络平台的安装包括jdk, openssl, httpd, tomcat等的安装。
IdP安装时,需要用到的软件包如下:
l
ntp-
l jdk-1_5_0_14-linux-i586.bin
l
openssl-
l
httpd-
l
apache-tomcat-
l shibboleth-idp-2.0-rc2-bin.zip
需要说明的是,在安装IdP的过程中,将尽量使用普通用户来进行,在必须使用根用户的地方,将会用蓝字标出。
在本次安装中,该普通用户名为ncpku,建立该用户后,将出现目录/home/ncpku。
定义NCPKU_HOME=/home/ncpku, NCPKU_COMMON=/home/ncpku/common。本次安装中,网络平台的软件都装在NCPKU_COMMON下。Shibboleth IdP安装在NCPKU_HOME/shibboleth-idp下。
安装软件时的源代码都放在NCPKU_HOME/allsrc下。
假设IdP安装在DNS名字为idp.ccnet.pku.edu.cn的服务器上。
参照本安装说明进行安装,将使IdP加入TestShib联盟。在安装之前,TestShib联盟会为每一台加入的IdP提供以下3个文件:
l 名为idp.ccnet.pku.edu.cn.crt的服务器证书;
l 名为idp.ccnet.pku.edu.cn.key.nopwd的服务器私钥;
l 名为testshib-providers.xml的联盟元文件。
确认服务器上安装有NTP,可以使用ntpdate命令校正时间。
否则,利用安装包ntp-
# ./configure
#make
#make install
在NCPKU_HOME下新建文件myenv.sh。
在其中写入如下内容:
export NCPKU_HOME=/home/ncpku
export NCPKU_COMMON=$NCPKU_HOME/common
export JAVA_HOME=$NCPKU_COMMON/jdk
export OPENSSL_HOME=$NCPKU_COMMON/openssl-
export HTTPD_HOME=$NCPKU_COMMON/httpd-
export
CATALINA_HOME=$NCPKU_COMMON/apache-tomcat-
export LD_LIBRARY_PATH=$OPENSSL_HOME/lib:$HTTPD_HOME/lib:$LD_LIBRARY_PATH
PATH=$JAVA_HOME/bin:$OPENSSL_HOME/bin:$HTTPD_HOME/bin:$CATALINA_HOME/bin:$PATH
export LANG=zh_CN
ntpdate pkuns.pku.edu.cn
hwclock -w
在NCPKU_HOME下,
# chmod +x myenv.sh
以后每次登录后,都要运行以下命令
# . /home/ncpku/myenv.sh
在NCPKU_HOME下新建文件restart.sh。
在其中写入如下内容:
$HTTPD_HOME/bin/apachectl -k stop
$CATALINA_HOME/bin/shutdown.sh
$HTTPD_HOME/bin/apachectl -k start -DSSL
$CATALINA_HOME/bin/startup.sh
在NCPKU_HOME下,
# chmod +x myenv.sh
以后每次重启IdP,只需运行以下命令
# /home/ncpku/restart.sh
把jdk安装包jdk-1_5_0_14-linux-i586.bin拷贝到NCPKU_COMMON下。
# chmod +x jdk-1_5_0_14-linux-i586.bin
# ./ jdk-1_5_0_14-linux-i586.bin
在NCPKU_COMMON下新建目录openssl-
把openssl安装包openssl-
在NCPKU_HOME/allsrc下,解压openssl-
# ./config threads shared zlib --prefix=$OPENSSL_HOME
# make
# make install
使用根用户执行以下命令:
# echo $OPENSSL_HOME/lib > /etc/ld.so.conf.d/ncpku_ld.conf
# ldconfig
在NCPKU_COMMON下新建目录httpd-
把httpd的安装包httpd-
在NCPKU_HOME/allsrc下,解压httpd-
# ./configure --prefix=$HTTPD_HOME --enable-rewrite --enable-so --enable-ssl --with-ssl=$OPENSSL_HOME --enable-proxy
# make
# make install
把tomcat安装包apache-tomcat-
# tar zxf apache-tomcat-
为了使httpd能够访问目录/home/ncpku,在目录/home/ncpku下,执行以下命令:
# chmod 755 /home/ncpku
修改HTTPD_HOME/conf/httpd.conf文件,
l 修改:ServerName idp.ccnet.pku.edu.cn
修改HTTPD_HOME/conf/httpd.conf文件,
l 将以下行取消注释:Include conf/extra/httpd-ssl.conf
修改HTTPD_HOME/conf/extra/httpd-ssl.conf文件,
l 修改:ServerName idp.ccnet.pku.edu.cn:443
将TestShib联盟所提供的idp.ccnet.pku.edu.cn.crt和idp.ccnet.pku.edu.cn.key.nopwd拷贝到目录HTTPD_HOME/conf下。
在HTTPD_HOME/conf/extra/httpd-ssl.conf中,
SSLCertificateFile conf/idp.ccnet.pku.edu.cn.crt
SSLCertificateKeyFile conf/idp.ccnet.pku.edu.cn.key.nopwd
在HTTPD_HOME/conf/httpd.conf的末尾,加入
ProxyPass /idp/ ajp://localhost:8009/idp/
ProxyPass /jsp-examples/ ajp://localhost:8009/jsp-examples/
在CATALINA_HOME/conf/server.xml中,在<Connector port="8009" …>中加入,
address="127.0.0.1" request.tomcatAuthentication="false"
在HTTPD_HOME/conf/httpd.conf中,加入,
#***************Shibboleth installation Basic AuthN configuration start******
<Location /idp/Authn/RemoteUser>
AuthType Basic
AuthName "My Identity Provider"
AuthUserFile conf/user.db
require valid-user
</Location>
#***************Shibboleth installation Basic AuthN configuration stop******
在HTTPD_HOME/bin下,
# htpasswd -c $HTTPD_HOME/conf/user.db user1
# htpasswd $HTTPD_HOME/conf/user.db user2
在HTTPD_HOME/conf/extra/httpd-ssl.conf中,在文件的末尾,加入
#***************Shibboleth installation attribute exchange configuration start******
Listen 8443
<VirtualHost _default_:8443>
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLVerifyClient optional_no_ca
SSLVerifyDepth 10
SSLOptions +StdEnvVars +ExportCertData
SSLCertificateFile conf/idp.ccnet.pku.edu.cn.crt
SSLCertificateKeyFile conf/idp.ccnet.pku.edu.cn.key.nopwd
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
</VirtualHost>
#***************Shibboleth installation attribute exchange configuration stop******
由于Apache使用了1024以下的端口80和443,所以为了启动Apache,需要用根用户来执行以下命令:
# $HTTPD_HOME/bin/apachectl -k start -DSSL
既可以使用普通用户ncpku也可以使用根用户来启动Tomcat,执行以下命令:
# $CATALINA_HOME/bin/startup.sh
为了检查到目前为止的安装是否正确,在浏览器中输入以下2个地址:
http://idp.ccnet.pku.edu.cn/jsp-examples/
https://idp.ccnet.pku.edu.cn/jsp-examples/
如果都能够显示Tomcat自带的示例程序jsp-examples的页面,则安装正确;否则,之前的安装过程存在错误。
在NCPKU_HOME下新建目录shibboleth-idp。
把IdP的安装包shibboleth-idp-2.0-rc2-bin.zip拷贝到NCPKU_HOME/allsrc下,并使用以下命令解压。
# unzip shibboleth-idp-2.0-rc2-bin.zip
进入目录identityprovider,执行以下命令:
# chmod +x ant.sh
# ./ant.sh
之后,界面上出现以下问题,需要键入回答。
-- Is this a new installation?
-- Yes
-- Where should the Shibboleth Identity Provider software be installed?
-- /home/ncpku/shibboleth-idp
-- What is the host name of the Shibboleth Identity Provider server?
-- idp.ccnet.pku.edu.cn
进入identityprovider/endorsed
# cp *.jar $CATALINA_HOME/common/endorsed
在NCPKU_HOME/shibboleth-idp/war下,
# cp idp.war $CATALINA_HOME/webapps
把TestShib联盟所提供的testshib-providers.xml拷贝到目录NCPKU_HOME\shibboleth-idp\metadata下。
在/home/ncpku/shibboleth-idp/conf/relying-party.xml中,修改元素<security:PrivateKey>和<security:Certificate>的内容,修改如下:
<security:PrivateKey>/home/ncpku/common/httpd-
修改元素<MetadataProvider>的属性metadataFile为:
metadataFile="/home/ncpku/shibboleth-idp/metadata/testshib-providers.xml"
启动IdP,需要:
l
使用根用户启动httpd:
$HTTPD_HOME/bin/apachectl -k start -DSSL
l 启动tomcat: $CATALINA_HOME/bin/startup.sh
在新建了文件restart.sh之后,只需使用以下命令:
# /home/ncpku/restart.sh
IdP上与提供属性相关的配置分为2部分:
l 在NCPKU_HOME\shibboleth-idp\conf\attribute-filter.xml中配置ARP
l 在NCPKU_HOME\shibboleth-idp\conf\attribute-resolver.xml中,属性定义和属性提供类(DataConnector).
在NCPKU_HOME\shibboleth-idp\conf\attribute-filter.xml中进行配置,
如在该文件中写入以下内容,
<AttributeFilterPolicy id="releaseUidToAnyone">
<PolicyRequirementRule xsi:type="basic:ANY" />
<AttributeRule attributeID="o:ou:uid">
<PermitValueRule xsi:type="basic:ANY" />
</AttributeRule>
</AttributeFilterPolicy>
<AttributeFilterPolicy id="releaseMailToAnyone">
<PolicyRequirementRule xsi:type="basic:ANY" />
<AttributeRule attributeID="o:ou:mail">
<PermitValueRule xsi:type="basic:ANY" />
</AttributeRule>
</AttributeFilterPolicy>
可以把名为” o:ou:uid”和” o:ou:mail”的属性提供给任何SP。
在NCPKU_HOME\shibboleth-idp\conf\attribute-resolver.xml中,配置属性定义和属性提供类。
在目前安装的IdP上主要有以下3种属性提供类(DataConnector):
l IdP自带的从LDAP中取得用户属性的DataConnector
l IdP自带的提供固定值属性的StaticDataConnector
在NCPKU_HOME\shibboleth-idp\conf\attribute-resolver.xml中,加入以下内容:
<resolver:AttributeDefinition id="o:ou:uid" xsi:type="Simple" xmlns="urn:mace:shibboleth:2.0:resolver:ad" sourceAttributeID="uid">
<resolver:Dependency ref="pku_ldap" />
<resolver:AttributeEncoder xsi:type="SAML1String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder" name="pku:uid" />
<resolver:AttributeEncoder xsi:type="SAML2String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder" name="pku:uid" friendlyName="pku:uid" />
</resolver:AttributeDefinition>
<resolver:AttributeDefinition id="o:ou:mail" xsi:type="Simple" xmlns="urn:mace:shibboleth:2.0:resolver:ad" sourceAttributeID="mail">
<resolver:Dependency ref="pku_ldap" />
<resolver:AttributeEncoder xsi:type="SAML1String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder" name="pku:mail" />
<resolver:AttributeEncoder xsi:type="SAML2String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder" name="pku:mail" friendlyName="pku:mail" />
</resolver:AttributeDefinition>
<resolver:DataConnector id="pku_ldap" xsi:type="LDAPDirectory" xmlns="urn:mace:shibboleth:2.0:resolver:dc" ldapURL="ldap://ldap.pku.edu.cn" baseDN="o=pku">
<FilterTemplate>
<![CDATA[(uid=$requestContext.principalName)]]>
</FilterTemplate>
</resolver:DataConnector>
在NCPKU_HOME\shibboleth-idp\conf\attribute-resolver.xml中,加入以下内容:
<resolver:AttributeDefinition id="o:ou:institution" xsi:type="Simple" xmlns="urn:mace:shibboleth:2.0:resolver:ad" sourceAttributeID="institution">
<resolver:Dependency ref="static" />
<resolver:AttributeEncoder xsi:type="SAML1String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder" name="pku:institution" />
<resolver:AttributeEncoder xsi:type="SAML2String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder" name="pku:institution" friendlyName="pku:institution" />
</resolver:AttributeDefinition>
<resolver:DataConnector id="static" xsi:type="dc:Static" xmlns="urn:mace:shibboleth:2.0:resolver:dc">
<Attribute id="institution">
<Value>PKU</Value>
</Attribute>
</resolver:DataConnector>
SP的安装大致可分为网络平台的安装和Shibboleth SP的安装两个部分。其中网络平台的安装包括httpd等的安装。
SP安装时,需要用到的软件包如下:
l
ntp-
l jdk-1_5_0_14-linux-i586.bin
l
openssl-
l
httpd-
l
apache-tomcat-
l log4shib-1.0-1.i386.rpm
l
xerces-c-
l
xml-security-c-
l xmltooling-1.0-5.i386.rpm
l opensaml-2.0-5.i386.rpm
l shibboleth-2.0-5.i386.rpm
需要说明的是,在安装SP的过程中,将尽量使用普通用户来进行,在必须使用根用户的地方,将会特别指出。
在本次安装中,该普通用户名为ncpku,建立该用户后,将出现目录/home/ncpku。
定义NCPKU_HOME=/home/ncpku, NCPKU_COMMON=/home/ncpku/common。本次安装中,网络平台的软件都装在NCPKU_COMMON下。安装软件时的源代码都放在NCPKU_HOME/allsrc下。
本次SP的安装使用了RPM包,而没有从源代码开始安装。
假设SP安装在DNS名字为sp.ccnet.pku.edu.cn的电脑上。
参照本安装说明进行安装,将使IdP加入TestShib联盟。在安装之前,CERNETFed联盟会为每一台加入的SP提供以下4个文件:
l 名为sp.ccnet.pku.edu.cn.crt的服务器证书;
l 名为sp.ccnet.pku.edu.cn.key.nopwd的服务器私钥;
l 名为testshib-providers.xml的联盟元文件;
l 名为shibboleth2.xml的配置文件。
确认服务器上安装有NTP,可以使用ntpdate命令校正时间。
否则,利用安装包ntp-
# ./configure
#make
#make install
在NCPKU_HOME下新建文件myenv.sh。
在其中写入如下内容:
export NCPKU_HOME=/home/ncpku
export NCPKU_COMMON=$NCPKU_HOME/common
export JAVA_HOME=$NCPKU_COMMON/jdk
export OPENSSL_HOME=$NCPKU_COMMON/openssl-
export HTTPD_HOME=$NCPKU_COMMON/httpd-
export
CATALINA_HOME=$NCPKU_COMMON/apache-tomcat-
export LD_LIBRARY_PATH=$OPENSSL_HOME/lib:$HTTPD_HOME/lib:$LD_LIBRARY_PATH
PATH=$JAVA_HOME/bin:$OPENSSL_HOME/bin:$HTTPD_HOME/bin:$CATALINA_HOME/bin:$PATH
export LANG=zh_CN
ntpdate pkuns.pku.edu.cn
hwclock -w
在NCPKU_HOME下,
# chmod +x myenv.sh
以后每次登录后,都要运行以下命令
# . /home/ncpku/myenv.sh
在NCPKU_HOME下新建文件restart.sh。
在其中写入如下内容:
$HTTPD_HOME/bin/apachectl -k stop
$CATALINA_HOME/bin/shutdown.sh
/etc/init.d/shibd stop
$HTTPD_HOME/bin/apachectl -k start -DSSL
$CATALINA_HOME/bin/startup.sh
/etc/init.d/shibd start
在NCPKU_HOME下,
# chmod +x myenv.sh
以后每次重启SP,只需运行以下命令
# /home/ncpku/restart.sh
把jdk安装包jdk-1_5_0_14-linux-i586.bin拷贝到NCPKU_COMMON下。
# chmod +x jdk-1_5_0_14-linux-i586.bin
# ./ jdk-1_5_0_14-linux-i586.bin
在NCPKU_COMMON下新建目录openssl-
把openssl安装包openssl-
在NCPKU_HOME/allsrc下,解压openssl-
# ./config threads shared zlib --prefix=$OPENSSL_HOME
# make
# make install
使用根用户执行以下命令:
# echo $OPENSSL_HOME/lib > /etc/ld.so.conf.d/ncpku_ld.conf
# ldconfig
在NCPKU_COMMON下新建目录httpd-
把httpd的安装包httpd-
在NCPKU_HOME/allsrc下,解压httpd-
# ./configure --prefix=$HTTPD_HOME --enable-rewrite --enable-so --enable-ssl --with-ssl=$OPENSSL_HOME --enable-proxy
# make
# make install
把tomcat安装包apache-tomcat-
# tar zxf apache-tomcat-
为了使httpd能够访问目录/home/ncpku,在目录/home/ncpku下,执行以下命令:
# chmod 755 /home/ncpku
修改HTTPD_HOME/conf/httpd.conf文件,
l 修改:ServerName sp.ccnet.pku.edu.cn
修改HTTPD_HOME/conf/httpd.conf文件,
l 修改:将以下行取消注释:Include conf/extra/httpd-ssl.conf
修改HTTPD_HOME/conf/extra/httpd-ssl.conf文件,
l 修改:ServerName sp.ccnet.pku.edu.cn:443
将TestShib联盟所提供的sp.ccnet.pku.edu.cn.crt和sp.ccnet.pku.edu.cn.key.nopwd拷贝到目录HTTPD_HOME/conf下。
在HTTPD_HOME/conf/extra/httpd-ssl.conf中,
SSLCertificateFile conf/sp.ccnet.pku.edu.cn.crt
SSLCertificateKeyFile conf/sp.ccnet.pku.edu.cn.key.nopwd
在HTTPD_HOME/conf/httpd.conf的末尾,加入
ProxyPass /jsp-examples/ ajp://localhost:8009/jsp-examples/
在CATALINA_HOME/conf/server.xml中,在<Connector port="8009" …>中加入,
address="127.0.0.1" request.tomcatAuthentication="false"
由于Apache使用了1024以下的端口80和443,所以为了启动Apache,需要用根用户来执行以下命令:
# $HTTPD_HOME/bin/apachectl -k start -DSSL
既可以使用普通用户ncpku也可以使用根用户来启动Tomcat,执行以下命令:
# $CATALINA_HOME/bin/startup.sh
为了检查到目前为止的安装是否正确,在浏览器中输入以下2个地址:
http://sp.ccnet.pku.edu.cn/jsp-examples/
https://sp.ccnet.pku.edu.cn/jsp-examples/
如果都能够显示Tomcat自带的示例程序jsp-examples的页面,则安装正确;否则,之前的安装过程存在错误。
先把以下rpm包拷贝到NCPKU_HOME/allsrc下:
l log4shib-1.0-1.i386.rpm
l
xerces-c-
l
xml-security-c-
l xmltooling-1.0-5.i386.rpm
l opensaml-2.0-5.i386.rpm
l shibboleth-2.0-5.i386.rpm
在NCPKU_HOME/allsrc下,使用根用户严格按顺序执行以下命令:
# rpm -ivh log4shib-1.0-1.i386.rpm
# rpm -ivh xerces-c-
# rpm -ivh xml-security-c-
# rpm �Civh xmltooling-1.0-5.i386.rpm
# rpm -ivh opensaml-2.0-5.i386.rpm
# rpm -ivh shibboleth-2.0-5.i386.rpm
SP 安装在/etc/shibboleth路径下。
在/etc/init.d下出现了SP中守护进程shibd的启动程序shibd。
要启动shibd,使用 # /etc/init.d/shibd start,或使用# service shibd start .
要停止shibd,使用 # /etc/init.d/shibd stop,或使用# service shibd stop .
在HTTPD_HOME/conf/httpd.conf中,加入
Include /etc/shibboleth/apache22.config
在HTTPD_HOME/conf/httpd.conf中,修改如下:
UseCanonicalName On
①将联盟所提供的shibboleth2.xml拷贝到/etc/shibboleth下。
②将联盟所提供的testshib-providers.xml拷贝到/etc/shibboleth下。
③修改/etc/shibboleth/shibboleth2.xml中的<CredentialResolver>元素为:
<CredentialResolver type="File">
<Key>
<Path>/home/ncpku/common/httpd-
</Key>
<Certificate>
<Path>/home/ncpku/common/httpd-
</Certificate>
</CredentialResolver>
④修改/etc/shibboleth/shibboleth2.xml中的<MetadataProvider>元素为:
<MetadataProvider type="XML"
file="/etc/shibboleth/testshib-providers.xml"/>
⑤在/etc/shibboleth/shibboleth2.xml中,加入一个元素<SessionInitiator>,如下:
<SessionInitiator
type="Chaining" Location="/Login2" id="idp_ccnet"
relayState="cookie"
entityID="https://idp.ccnet.pku.edu.cn/idp/shibboleth">
<SessionInitiator
type="SAML2" defaultACSIndex="1"
template="/etc/shibboleth/bindingTemplate.html"/>
<SessionInitiator type="Shib1"
defaultACSIndex="5"/>
</SessionInitiator>
⑥在HTTPD_HOME/conf/httpd.conf中,加入
ProxyPass /testidpccnet ajp://localhost:8009/testidpccnet
⑦在/etc/shibboleth/shibboleth2.xml的元素<Host name="sp.ccnet.pku.edu.cn">中,加入一个元素<Path>如下:
<Path
name="testidpccnet" authType="shibboleth"
requireSession="true" requireSessionWith="idp_ccnet"/>
⑧在/etc/shibboleth/apache22.config中,加入
<Location /testidpccnet>
AuthType
shibboleth
ShibRequireSession On
require
valid-user
ShibUseHeaders
On
</Location>
/etc/shibboleth/native.logger中,修改如下,
l 第2行,log4j.rootCategory=DEBUG, shibd_log
l 第5行,log4j.category.XMLTooling.XMLObject=DEBUG
l 第10行,log4j.appender.native_log.fileName=/etc/shibboleth/log/native.log
/etc/shibboleth/shibd.logger中,
l
第2行,log4j.appender.shibd_log.fileName=/etc/shibboleth/shibd.log
l
第5行,log4j.category.SAML.XML=DEBUG
l
第9行,log4j.category.Shibboleth-TRANSACTION=DEBUG,
tran_log
l
第24行,log4j.appender.shibd_log.fileName=/etc/shibboleth/log/shibd.log
在/etc/shibboleth下,创建目录log,在/etc/shibboleth/log下创建文件shibd.log, native.log和transaction.log
# chmod a+w shibd.log
# chmod a+w native.log
# chmod a+w transaction.log
按2.4节中的方法启动SP,在IE中访问https://sp.ccnet.pku.edu.cn/testidpccnet时,就会被重定向到idp.ccnet上,idp.ccnet会要求用户进行认证,认证通过后,用户被重定向到sp.ccnet上用户要访问的链接处。
启动SP包括:
l
使用根用户启动shibd:
/etc/init.d/shibd start
l
使用根用户启动httpd:
$HTTPD_HOME/bin/apachectl -k start �CDSSL
l 启动tomcat: $CATALINA_HOME/bin/startup.sh
在新建了文件restart.sh之后,只需使用以下命令:
# /home/ncpku/restart.sh
为了在Web Application中取得用户属性,在SP上需要进行的配置可以分为以下3部分:
l 在/etc/shibboleth/attribute-map.xml中配置属性映射。
l 在/etc/shibboleth/attribute-policy.xml中配置属性接受策略(AAP)
l 在/etc/shibboleth/apache22.config和/etc/shibboleth/shibboleth.xml中把特定的URL配置为受保护的资源
l 对于Java Web Application来说,需要在$HTTPD_HOME/conf/ssl.conf中要求JK对于特定的URL把用户属性以环境变量的方式传给Tomcat;而对于PHP应用来说,直接在PHP程序中就可以取得用户的属性。
下面以名为”kuayu”的Web Application为例。
在/etc/shibboleth/attribute-map.xml中加入以下内容:
<Attribute name="pku:uid"
id="pku:sp:uid"/>
<Attribute name="pku:mail"
id="pku:sp:mail"/>
在缺省情况下,SP允许每个属性到达应用程序,无需特殊配置。
见2.3.3的⑥、⑦和⑧,即:
⑥在HTTPD_HOME/conf/httpd.conf中,加入
ProxyPass /testidpccnet ajp://localhost:8009/testidpccnet
⑦在/etc/shibboleth/shibboleth2.xml的元素<Host name="sp.ccnet.pku.edu.cn">中,加入一个元素<Path>如下:
<Path
name="testidpccnet" authType="shibboleth"
requireSession="true" requireSessionWith="idp_ccnet"/>
⑧在/etc/shibboleth/apache22.config中,加入
<Location /testidpccnet>
AuthType
shibboleth
ShibRequireSession On
require
valid-user
ShibUseHeaders
On
</Location>
在”kuayu”中,使用以下语句来取得用户的属性:
String uid = request.getHeader("pku:sp:uid");
String uid = request.getHeader("pku:sp:mail");
针对PHP应用,在Apache上安装了PHP模块后,使用以下2句来取得用户的属性:
echo $_SERVER['pku:sp:uid'];
echo $_SERVER['pku:sp:mail'];