Skip to content

Commit

Permalink
fix(auth): Split values when checking EndUser scopes (#1764)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

## Related Issue(s)

- #1675

## Verification

- [ ] **Your** code builds clean without any errors or warnings
- [ ] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)

## Documentation

- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)
  • Loading branch information
oskogstad authored Jan 30, 2025
1 parent 9b63326 commit 5957e7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void Configure(AuthorizationOptions options)
{
var userScopes = context.User
.FindAll(AuthorizationPolicyBuilderExtensions.ScopeClaim)
.Select(s => s.Value)
.SelectMany(s => s.Value.Split(" "))
.ToList();

return userScopes.Contains(AuthorizationScope.EndUser) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void Configure(AuthorizationOptions options)
{
var userScopes = context.User
.FindAll(AuthorizationPolicyBuilderExtensions.ScopeClaim)
.Select(s => s.Value)
.SelectMany(s => s.Value.Split(" "))
.ToList();

return userScopes.Contains(AuthorizationScope.EndUser) ||
Expand Down

0 comments on commit 5957e7d

Please sign in to comment.