mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-06 09:30:29 +00:00
added comment
This commit is contained in:
parent
6ed73d34d9
commit
ad0d69027a
1 changed files with 4 additions and 3 deletions
|
@ -95,6 +95,7 @@ func (ctrl *V1Controller) HandleSsoHeaderLogin() errchain.HandlerFunc {
|
||||||
if !ctrl.headerSSOEnabled {
|
if !ctrl.headerSSOEnabled {
|
||||||
return validate.NewRequestError(errors.New("authentication failed. Header SSO is disaled"), http.StatusInternalServerError)
|
return validate.NewRequestError(errors.New("authentication failed. Header SSO is disaled"), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
t := strings.Split(r.RemoteAddr, ":")
|
t := strings.Split(r.RemoteAddr, ":")
|
||||||
if t[0] != ctrl.headerSSOAllowedIP {
|
if t[0] != ctrl.headerSSOAllowedIP {
|
||||||
|
@ -115,10 +116,10 @@ func (ctrl *V1Controller) HandleSsoHeaderLogin() errchain.HandlerFunc {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// user not found -> create it
|
// user not found -> create it
|
||||||
var username = r.Header.Get("Remote-Name")
|
var username = r.Header.Get("Remote-Name")
|
||||||
|
|
||||||
|
// if groups are provided, they will be comma-separated. take only the first group
|
||||||
var groups = r.Header.Get("Remote-Groups")
|
var groups = r.Header.Get("Remote-Groups")
|
||||||
|
|
||||||
var groupArr = strings.Split(groups, ",")
|
var groupArr = strings.Split(groups, ",")
|
||||||
|
|
||||||
groupTok := ""
|
groupTok := ""
|
||||||
if len(groupArr) > 0 {
|
if len(groupArr) > 0 {
|
||||||
groupTok = groupArr[0]
|
groupTok = groupArr[0]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue