From 8e7552c9a4e68ace4b5da5a40785069bef0a7e09 Mon Sep 17 00:00:00 2001 From: Ashish Bhat Date: Thu, 25 Jul 2019 12:59:30 +0530 Subject: [PATCH] Scope Validation --- security/Token.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/security/Token.go b/security/Token.go index 6740e4f..1a2d698 100644 --- a/security/Token.go +++ b/security/Token.go @@ -41,7 +41,9 @@ func (token *JwtToken) isValidForScope(allowedScopes []string) bool { if ok, _ := inArray(allowedScope, token.Scopes); !ok { scopeParts := strings.Split(allowedScope, ":") if ok, _ := inArray(scopeParts[0]+":*", token.Scopes); !ok { - allScopesMatched = false + if ok, _ := inArray("*:"+scopeParts[1], token.Scopes); !ok { + allScopesMatched = false + } } } }