New option to enable local auth for everyone
This commit is contained in:
parent
ff5cefa7ac
commit
b572938283
3 changed files with 13 additions and 9 deletions
20
auth_krb5.go
20
auth_krb5.go
|
|
@ -42,17 +42,19 @@ func checkAuthKrb5(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
found := false
|
||||
for _, u := range localAuthUsers {
|
||||
if lf.Login == u {
|
||||
found = true
|
||||
break
|
||||
if !allowLocalAuth {
|
||||
found := false
|
||||
for _, u := range localAuthUsers {
|
||||
if lf.Login == u {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !userExists(lf.Login) && !found {
|
||||
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"errmsg": "You are not allowed to log you in this way. Please use OpenID Connect."})
|
||||
return
|
||||
if !userExists(lf.Login) && !found {
|
||||
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"errmsg": "You are not allowed to log you in this way. Please use OpenID Connect."})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
cnf := config.New()
|
||||
|
|
|
|||
Reference in a new issue