You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can get all preview versions from [GitHub Packages](https://github.com/orgs/graphql-dotnet/packages?repo_name=authorization).
29
29
Note that GitHub requires authentication to consume the feed. See [here](https://docs.github.com/en/free-pro-team@latest/packages/publishing-and-managing-packages/about-github-packages#authenticating-to-github-packages).
30
30
31
31
# Usage
32
32
33
-
* Register the authorization classes in your DI container - `IAuthorizationEvaluator`, `AuthorizationSettings`, and the `AuthorizationValidationRule`.
34
-
* Provide a custom `UserContext` class that implements `IProvideClaimsPrincipal`.
35
-
* Add policies to the `AuthorizationSettings`.
36
-
* Apply a policy to a GraphType or Field (both implement `IProvideMetadata`):
33
+
- Register the authorization classes in your DI container - `IAuthorizationEvaluator`, `AuthorizationSettings`, and the `AuthorizationValidationRule`.
34
+
- Provide a custom `UserContext` class that implements `IProvideClaimsPrincipal`.
35
+
- Add policies to the `AuthorizationSettings`.
36
+
- Apply a policy to a GraphType or Field (both implement `IProvideMetadata`):
37
37
- using `AuthorizeWith(string policy)` extension method
38
38
- or with `GraphQLAuthorize` attribute if using Schema + Handler syntax.
39
-
* The `AuthorizationValidationRule` will run and verify the policies based on the registered policies.
40
-
* You can write your own `IAuthorizationRequirement`.
39
+
- The `AuthorizationValidationRule` will run and verify the policies based on the registered policies.
40
+
- You can write your own `IAuthorizationRequirement`.
41
41
42
42
# Examples
43
43
@@ -61,20 +61,20 @@ public class MyType : ObjectGraphType
61
61
4. Schema first syntax - use `GraphQLAuthorize` attribute on type, method or property.
0 commit comments