Skip to content

Changed scopes claim retrival to use the scp field instead of the scps#37

Open
thomascrha wants to merge 1 commit intoantarctica:mainfrom
thomascrha:bugfix/fix-scope-definition-from-claims
Open

Changed scopes claim retrival to use the scp field instead of the scps#37
thomascrha wants to merge 1 commit intoantarctica:mainfrom
thomascrha:bugfix/fix-scope-definition-from-claims

Conversation

@thomascrha
Copy link
Copy Markdown

@thomascrha thomascrha commented Nov 15, 2025

Within the current implementation flask-entra-auth tries to extract the scopes from the token claims using the scps key - this key doesn't seem to exist within the claim spec - see here https://learn.microsoft.com/en-us/entra/identity-platform/access-token-claims-reference#payload-claims

image

Within the spec itself the string scps is never mentioned and I can't find if this was potentially changed at some point - so my assumption is that this functionality has never worked.

Currently the lib assumes that the scopes are an array of strings (similar to roles) - but according to the spec the scopes (scp) is a "String, a space separated list of scopes" - What this means is that in the current implementation no scopes are ever actually captured and can never be checked against.

I've adjusted the test suite also and have them all passing
image

Linked issue: #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant