@@ -105,7 +105,6 @@ type OAuthProxy struct {
105105 trustedIPs *ip.NetSet
106106 Banner string
107107 Footer string
108− AllowedGroups []string
109108
110109 sessionChain alice.Chain
111110 headersChain alice.Chain
@@ -219,7 +218,6 @@ func NewOAuthProxy(opts *options.Options, validator func(string) bool) (*OAuthPr
219218 Banner: opts.Banner,
220219 Footer: opts.Footer,
221220 SignInMessage: buildSignInMessage(opts),
222− AllowedGroups: opts.AllowedGroups,
223221
224222 basicAuthValidator: basicAuthValidator,
225223 displayHtpasswdForm: basicAuthValidator != nil && opts.DisplayHtpasswdForm,
@@ -992,13 +990,12 @@ func (p *OAuthProxy) getAuthenticatedSession(rw http.ResponseWriter, req *http.R
992990 }
993991
994992 invalidEmail := session.Email != "" && !p.Validator(session.Email)
995− invalidGroups := session != nil && !p.validateGroups(session.Groups)
996993 authorized, err := p.provider.Authorize(req.Context(), session)
997994 if err != nil {
998995 logger.Errorf("Error with authorization: %v", err)
999996 }
1000997
1001− if invalidEmail || invalidGroups || !authorized {
998+ if invalidEmail || !authorized {
1002999 logger.PrintAuthf(session.Email, req, logger.AuthFailure, "Invalid authentication via session: removing session %s", session)
10031000 // Invalid session, clear it
10041001 err := p.ClearSessionCookie(rw, req)
@@ -1037,23 +1034,3 @@ func (p *OAuthProxy) ErrorJSON(rw http.ResponseWriter, code int) {
10371034 rw.Header().Set("Content-Type", applicationJSON)
10381035 rw.WriteHeader(code)
10391036}
1040−
1041−func (p *OAuthProxy) validateGroups(groups []string) bool {
1042− if len(p.AllowedGroups) == 0 {
1043− return true
1044− }
1045−
1046− allowedGroups := map[string]struct{}{}
1047−
1048− for _, group := range p.AllowedGroups {
1049− allowedGroups[group] = struct{}{}
1050− }
1051−
1052− for _, group := range groups {
1053− if _, ok := allowedGroups[group]; ok {
1054− return true
1055− }
1056− }
1057−
1058− return false
1059−}