Skip to content

Need a more real world example #30704

Open

Description

Description

[Enter feedback here]
The article starts out with "Suppose you had a repository of rules you wanted to evaluate inside an authorization handler and that repository was registered in the service collection. Authorization resolves and injects that into the constructor." (Which is similar to what I need) but then the example is just a simple logger factory, not a rules repository.

Could you please expand it and show how to pass a Scoped Service (Already defined in the builder, but I need a reference to the same "singleton-like" service that the builder is going to create) into the policy requirement.

Thank you

Page URL

https://learn.microsoft.com/en-us/aspnet/core/security/authorization/dependencyinjection?view=aspnetcore-7.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/authorization/dependencyinjection.md

Document ID

5c2b0d48-ef1a-5875-35d1-865cb022fa71

Article author

Rick-Anderson

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions