@@ -78,6 +78,7 @@ type OAuthProxy struct {
7878 sessionStore sessionsapi.SessionStore
7979 ProxyPrefix string
8080 basicAuthValidator basic.Validator
81+ basicAuthGroups []string
8182 SkipProviderButton bool
8283 skipAuthPreflight bool
8384 skipJwtBearerTokens bool
@@ -200,6 +201,7 @@ func NewOAuthProxy(opts *options.Options, validator func(string) bool) (*OAuthPr
200201 trustedIPs: trustedIPs,
201202
202203 basicAuthValidator: basicAuthValidator,
204+ basicAuthGroups: opts.HtpasswdUserGroups,
203205 sessionChain: sessionChain,
204206 headersChain: headersChain,
205207 preAuthChain: preAuthChain,
@@ -534,7 +536,7 @@ func (p *OAuthProxy) isTrustedIP(req *http.Request) bool {
534536 return p.trustedIPs.Has(remoteAddr)
535537}
536538
537−// SignInPage writes the sing in template to the response
539+// SignInPage writes the sign in template to the response
538540func (p *OAuthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code int) {
539541 prepareNoCache(rw)
540542 err := p.ClearSessionCookie(rw, req)
@@ -589,7 +591,7 @@ func (p *OAuthProxy) SignIn(rw http.ResponseWriter, req *http.Request) {
589591
590592 user, ok := p.ManualSignIn(req)
591593 if ok {
592− session := &sessionsapi.SessionState{User: user}
594+ session := &sessionsapi.SessionState{User: user, Groups: p.basicAuthGroups}
593595 err = p.SaveSession(rw, req, session)
594596 if err != nil {
595597 logger.Printf("Error saving session: %v", err)