Freeradius

在 FreeRadius 中配置 rlm_rest 模組

  • September 27, 2017

使用 FreeRADIUS 我需要針對 Web 後端對 RADIUS 使用者進行身份驗證,並且一直在嘗試使用 rlm_rest 模組來執行此操作。見這裡

在我的站點配置中,我有這樣的東西:

authorize {
   rest
}

在身份驗證部分我嘗試過這樣的事情:

authenticate {
   Auth-Type REST {
       rest
   }
}

或者

authenticate {
   rest
}

在任何一種情況下,我都會收到以下錯誤:(2) ERROR: No Auth-Type found: rejecting the user via Post-Auth-Type = Reject

在我的網路伺服器上,我正在返回,204 code因為它似乎應該在沒有額外過程的情況下對使用者進行身份驗證。見這裡。授權似乎工作正常,但是一旦到達身份驗證部分,就會返回該錯誤。

我需要知道的是我需要允許 rlm_rest 模組完成請求的身份驗證部分的“使用者”文件條目和站點可用條目的組合。謝謝,

Rest 沒有設置 Auth-Type,你必須手動設置。

authorize {
   rest
   if (ok) {
       update control {
           Auth-Type := rest
       }
   }
}

authenticate {
   rest
}

Auth-Types 是為在 authenticate 中列出的模組自動創建的(您實際上並不需要 Auth-Type 節)。

如果不需要,您不需要在授權中呼叫休息,這樣的事情也可以正常工作:

authorize {
   if (User-Password) {
       update control {
           Auth-Type := rest
       }
   }
}

編輯:

注意:在 3.0.4 版本之前,REST 模組用於control:Cleartext-Password獲取使用者密碼,因此為了使模組正常工作,您需要從以下位置複製值request:User-Password

authorize {
   if (User-Password) {
       update control {
           Cleartext-Password := &User-Password
           Auth-Type := rest
       }
   }
}

版本 3.0.4 和更高版本會尋找request:User-Password,這在大多數情況下應該可以正常工作。

引用自:https://serverfault.com/questions/597393