CAS對接華為雲SAML,作為idp斷言提供者(也稱身份提供商)


基於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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM