Skip to content

Commit 8457ff7

Browse files
committed
feat: support radiusDefaultOrganization in app.conf
1 parent 888a6f2 commit 8457ff7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

conf/app.conf

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ ldapServerPort = 389
2828
ldapsCertId = ""
2929
ldapsServerPort = 636
3030
radiusServerPort = 1812
31+
radiusDefaultOrganization = "built-in"
3132
radiusSecret = "secret"
3233
quota = {"organization": -1, "user": -1, "application": -1, "provider": -1}
3334
logConfig = {"filename": "logs/casdoor.log", "maxdays":99999, "perm":"0770"}

radius/server.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ func handleAccessRequest(w radius.ResponseWriter, r *radius.Request) {
6868
log.Printf("handleAccessRequest() username=%v, org=%v, password=%v", username, organization, password)
6969

7070
if organization == "" {
71-
w.Write(r.Response(radius.CodeAccessReject))
72-
return
71+
organization = conf.GetConfigString("radiusDefaultOrganization")
72+
if organization == "" {
73+
organization = "built-in"
74+
}
7375
}
7476

7577
var user *object.User

0 commit comments

Comments
 (0)