owncloud / owncloud/ocis

Support "roles" claim when it contains a string (for AD FS)

Open
#7,660 1 comment 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

AFAICT this code requires the access token to always contain an array of roles:
```
claimRolesRaw, ok := claims[ra.rolesClaim].([]interface{})
if !ok {
logger.Error().Str("rolesClaim", ra.rolesClaim).Msg("No roles in user claims")
return nil, errors.New("no roles in user claims")
}
```

AD FS will set `"roles":"user"` when the user is only in a single group and `"roles:["user","spaceadmin"]"` when the user is in more than one group.

We can force the array by adding an additional dummy role, but IMO we should support string values for the roles claim.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.