基於cas-overlay-template(https://github.com/apereo/cas-overlay-template)5.3分支代碼
1、新增maven依賴
<dependency> <groupId>org.apereo.cas</groupId> <artifactId>cas-server-support-saml-idp</artifactId> <version>${cas.version}</version> </dependency>
2、在src/main/resources/services目錄下新增SAML-10000004.json,內容如下:
{ "@class" : "org.apereo.cas.support.saml.services.SamlRegisteredService", "serviceId" : ".+", "name" : "SAMLService", "id" : 10000004, "evaluationOrder" : 10, "metadataLocation" : "https://auth.huaweicloud.com/authui/saml/metadata.xml" }
3、新增application.yml,內容如下:
cas:
tgc:
secure: false
serviceRegistry:
initFromJson: true
server:
name: http://172.16.101.103:8080
prefix: ${cas.server.name}/cas
authn:
saml-idp:
entityId: GeoStack
scope: "*"
metadata:
location: file:/etc/cas/saml
cas.server.name自行修改為CAS部署的IP和端口號,創建/etc/cas/saml目錄
然后mvn clean package打包成war包
參考:https://apereo.github.io/cas/5.3.x/installation/Configuring-SAML2-Authentication.html
