DavidParks8 / Owin-Authorization

Backport of Asp.Net core's policy based authorization to Asp.Net 4
Other
60 stars 16 forks source link

Don't block on call to IsAuthorizedAsync in ResourceAuthorizeAttribute #67

Closed adamkirkton closed 2 years ago

adamkirkton commented 4 years ago

Pull request to fix the issue described in Issue #66

After calling the base implementation of OnAuthorizationAsync which in turn calls the synchronous OnAuthorization, if authorization fails then an HttpResponseMessage will have been set on the actionContext. If nothing has been set, then authorization has passed and we can do our additional checks and set the response if they fail.

DavidParks8 commented 3 years ago

@adamkirkton there are code analysis warnings from the PR build. Please fix them.

adamkirkton commented 3 years ago

Hi @DavidParks8, what tool are you using for Code Analysis so I can find them and fix them?

adamkirkton commented 3 years ago

Ah, I think I found what you're talking about. I found how to dig into the Azure DevOps build. The two warnings that I see are for code that I did not modify and don't feel comfortable trying to change. They are for IsAuthorizedAsync in AuthorizationHelper. If you can't accept the PR in this case, I can just close it. Thanks!

IlSocio commented 2 years ago

@DavidParks8 any news about this PR?

DavidParks8 commented 2 years ago

Deadlock has been fixed by a different commit.