feat: role claims for service user tokens (#5577)

tokens of service users can now contain role claims by requesting them through scopes
This commit is contained in:
Silvan
2023-04-03 14:26:51 +02:00
committed by GitHub
parent 4691298eb6
commit e688954308
6 changed files with 158 additions and 67 deletions

View File

@@ -112,10 +112,13 @@ func (c *Client) IsScopeAllowed(scope string) bool {
if strings.HasPrefix(scope, domain.SelectIDPScope) {
return true
}
if strings.HasPrefix(scope, ScopeUserMetaData) {
if scope == ScopeUserMetaData {
return true
}
if strings.HasPrefix(scope, ScopeResourceOwner) {
if scope == ScopeResourceOwner {
return true
}
if scope == ScopeProjectsRoles {
return true
}
for _, allowedScope := range c.allowedScopes {