<style> .red { color: red; } </style> # SSO 技術實踐: CAS Server 整合 Radius Authenticaiton ###### tags: `CAS`, `Radius authen` ## 前言: 此篇只會介紹關於CAS Server在搭配Radius認證時所需要的配置,以及遇到的一些雷點,關於Radius Server本身怎麼架設並不會過多描述。 ## Radius Authentication 先附上CAS社群文件: [Radius Authentication](https://apereo.github.io/cas/6.0.x/mfa/RADIUS-[Authentication.html#radius-authentication)[1] [Radius Configuration](https://apereo.github.io/cas/6.0.x/configuration/Configuration-Properties-Common.html#radius-configuration)[2] 附上實際上application.xml的設定配置: ```xml= cas.authn.radius.client.authenticationPort=1812 cas.authn.radius.client.sharedSecret=Radius Server設定的shared secret cas.authn.radius.client.socketTimeout=0 cas.authn.radius.client.inetAddress= Radius Server的ip or domain name cas.authn.radius.client.accountingPort=1813 ``` 這邊需要解釋一下為何只需要設定cas.authn.radius.client的部分: 由於在實作時,<span class="red">並沒有架設一層nas或者vpn</span>,如果今天在CAS Server的環境下有架設vpn or nas去專門連到Radius Server,那麼架構應該會像[這篇文](https://www.lijyyh.com/2013/07/radius-configuring-radius-server.html)[3]當中那樣,CAS Server會先打到vpn、nas或等等其他的中間層,這個中間層再跟Radius Server溝通。那麼這個時候就需要去設定cas.authn.radius.servere的部分了。 <span class="red">再次提醒,cas.authn.radius.client是去設定實際Radius Server的相關設定!!</span> 雖然以Radius架構的觀點來說,CAS Server其實就是Radius client的腳色,有可能會誤會需要將Radius Serveer的設定寫在cas.authn.radius.server之中。 ## Trouble Shooting 關於設定Radius Authen踩過一些雷,這邊統一紀錄一下: 1. 根據社群內部文件,只設定`compile "org.apereo.cas:cas-server-support-radius:${project.'cas.version'}"`是不夠的,因為不知為何,在gradle compile過後,最核心的jradius套件並不會下載下來,而且也不會出錯,只有等到server啟動之後,才會發現怎麼噴exception出來。 所以還需要手動加入幾個套件,但請別加入github.coova開頭的,因為`compile "org.apereo.cas:cas-server-support-radius:${project.'cas.version'}"`就是引用了`com.github.coova.jradius`,但卻沒抓下來jradius的罪魁禍首... 請加入以下套件: ```xml= // https://mvnrepository.com/artifact/net.jradius/jradius-core compile group: 'net.jradius', name: 'jradius-core', version: '1.1.5' // https://mvnrepository.com/artifact/net.jradius/jradius-dictionary compile group: 'net.jradius', name: 'jradius-dictionary', version: '1.1.5' // https://mvnrepository.com/artifact/net.jradius/jradius-extended compile group: 'net.jradius', name: 'jradius-extended', version: '1.1.5' ``` 2. 解決完第一點後,還發生了明明輸入了正確的帳號密碼,radius client也回傳帳號驗證成功,但在前端顯示卻出現invalid authentication,追查原始碼後可以發現在帳號驗證通過後,會觸發一個trigger class`RadiusAccessChallengedMultifactorAuthenticationTrigger.java`,裡面會檢查是否有提供mfa provider的機制,如果沒有的話,即便帳號密碼驗證通過了,還是會直接噴error出來。 因此還需要加入一個插件來解決mfa provider,請加入: `compile "org.apereo.cas:cas-server-support-radius-mfa:${project.'cas.version'}"`,這樣就能解決mfa provider為空導致出錯的問題。 這邊也提供當初找很久終於找到一篇相關的討論,在此附上[連結](https://www.mail-archive.com/cas-user@apereo.org/msg10302.html)。 3. 如果連不上radius server,請確認是否有配置白名單 ## Reference: [1] [Radius Authentication](https://apereo.github.io/cas/6.0.x/mfa/RADIUS-Authentication.html#radius-authentication) [2] [Radius Configuration](https://apereo.github.io/cas/6.0.x/configuration/Configuration-Properties-Common.html#radius-configuration) [3] [架設Radius伺服器實務](https://www.lijyyh.com/2013/07/radius-configuring-radius-server.html) [4] [Radius Authentication seems not work if MFA is not enabled on CAS 6.1.x, is that intended?](https://www.mail-archive.com/cas-user@apereo.org/msg10302.html)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up