Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] RequiredScope RequiredScopesConfigurationKey - possible bug (or at least docs issue) #1036

Closed
1 task done
jbradt-stiles opened this issue Mar 2, 2021 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Milestone

Comments

@jbradt-stiles
Copy link

Which version of Microsoft Identity Web are you using?
1.7

Where is the issue?

  • Web API
    • Protected web APIs (validating scopes)

Is this a new or an existing app?
The app is in production and I have upgraded to a new version of Microsoft Identity Web.

Repro

following the documentation located at https://github.com/AzureAD/microsoft-identity-web/wiki/Web-APIs#using-the-requiredscopes-attribute

I've added the attribute

[RequiredScope(RequiredScopesConfigurationKey = "AzureAd:Scopes")

(btw, there is a end brace missing in the docs)

and attempt to use the controller.

An exception is thrown

System.InvalidOperationException: A suitable constructor for type 'Microsoft.Identity.Web.Resource.RequiredScopeFilter' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.

If I use

[RequiredScope("access_as_user")

(again, missing end brace in the docs)

there is no exception.

So, is there a dependency that needs to be configured? If so, can the doc's be updated to reflect that requirement?

Or, should this 'just work'?

Thanks,
James

Expected behavior
Have the docs reflect what is required and exceptions not thrown

Actual behavior
exceptions are being thrown

@jmprieur jmprieur added the bug Something isn't working label Mar 4, 2021
@jmprieur jmprieur added this to the 1.9.0 milestone Mar 4, 2021
@jennyf19 jennyf19 modified the milestones: 1.9.0, 1.10.0 Mar 31, 2021
@jennyf19 jennyf19 modified the milestones: 1.10.0, 1.12.0 May 14, 2021
@jennyf19 jennyf19 modified the milestones: 1.12.0, 1.13.0 May 28, 2021
@jmprieur jmprieur added the duplicate This issue or pull request already exists label May 31, 2021
@jmprieur
Copy link
Collaborator

jmprieur commented Jun 2, 2021

@jbradt-stiles this is fixed in 1.12.0 released today

@jmprieur jmprieur closed this as completed Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants