server: allow extra spaces in scopes

go-oidc sends an extra space before the list of scopes. This is bad
but we have to support it, so we'll be more lenient and ignore
duplicated whitespace.
This commit is contained in:
Eric Chiang
2016-10-12 15:31:01 -07:00
parent cf8801dcec
commit 2834da443f
3 changed files with 30 additions and 2 deletions

View File

@@ -537,7 +537,7 @@ func (s *Server) handleRefreshToken(w http.ResponseWriter, r *http.Request, clie
scopes := refresh.Scopes
if scope != "" {
requestedScopes := strings.Split(scope, " ")
requestedScopes := strings.Fields(scope)
var unauthorizedScopes []string
for _, s := range requestedScopes {