Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Fix the token type helper method #299

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private bool IsAppOnlyToken()
else
{
// alternatively, if an AT contains the roles claim but no scp claim, that indicates it's an app token
return HttpContext.User.Claims.Any(c => c.Type == "roles") && HttpContext.User.Claims.Any(c => c.Type != "scp");
return HttpContext.User.Claims.Any(c => c.Type == "roles") && !HttpContext.User.Claims.Any(c => c.Type == "scp");
}
}

Expand Down
2 changes: 1 addition & 1 deletion 3-Authorization-II/1-call-api/README-incremental.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ private bool IsAppOnlyToken()
else
{
// alternatively, if an AT contains the roles claim but no scp claim, that indicates it's an app token
return HttpContext.User.Claims.Any(c => c.Type == "roles") && HttpContext.User.Claims.Any(c => c.Type != "scp");
return HttpContext.User.Claims.Any(c => c.Type == "roles") && !HttpContext.User.Claims.Any(c => c.Type == "scp");
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion 3-Authorization-II/1-call-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private bool IsAppOnlyToken()
else
{
// alternatively, if an AT contains the roles claim but no scp claim, that indicates it's an app token
return HttpContext.User.Claims.Any(c => c.Type == "roles") && HttpContext.User.Claims.Any(c => c.Type != "scp");
return HttpContext.User.Claims.Any(c => c.Type == "roles") && !HttpContext.User.Claims.Any(c => c.Type == "scp");
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private bool IsAppOnlyToken()
else
{
// alternatively, if an AT contains the roles claim but no scp claim, that indicates it's an app token
return HttpContext.User.Claims.Any(c => c.Type == "roles") && HttpContext.User.Claims.Any(c => c.Type != "scp");
return HttpContext.User.Claims.Any(c => c.Type == "roles") && !HttpContext.User.Claims.Any(c => c.Type == "scp");
}
}

Expand Down