RequireScope() DI Registration from PolicyBuilderExtensions #1882
followynne
started this conversation in
Documentation Gaps
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hello all 😃,
I used RequireScope from Microsoft.Identity.Web.PolicyBuilderExtensions to register scopes from within
AddAuthorization.I wrote a test on it but I wasn't able to make the policy work, until I found out that I needed to add the following extension method:
In the description of RequireScope there's no mention to this requirement, while in AddRequiredScopeAuthorization docs it refers specifically to the RequireScope as an attribute.
Is this the correct flow to register RequireScope extensions or should it work out-of-the-box?
If that's the case, could it be interesting a PR to add in the XML Doc of the file a reference to this detail?
(an example:)
/// Requires the registration of <see cref="Microsoft.Identity.Web.RequiredScopeExtensions.AddRequiredScopeAuthorization"/>Thanks for the help 😊
Replicate the behavior (on xUnit project)
Test will fail - uncomment line at the end of the file to make it pass
Beta Was this translation helpful? Give feedback.
All reactions