dotnet / dotnet/aspnetcore

Add support for CancellationToken in AuthorizationHandler or AuthorizationHandlerContext

Open
#56,272 4 comments 6 reactions 0 assignees View on GitHub
area-auth
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

We would need a CancellationToken in our AuthorizationHandlers.

### Describe the solution you'd like

As discussed in previous issues (https://github.com/dotnet/aspnetcore/issues/2746 & https://github.com/aspnet/Security/issues/1598) a non-breaking way of doing this would be to add the CancellationToken in the AuthorizationHandlerContext.

A work around we have for now it to get the ctx from the HttpContextAccessor.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.