IAuthorizationProvider

Namespace: ASPSecurityKit.AuthProviders
Assembly: ASPSecurityKit.dll

Summary

Provides an interface to perform the authorization step of the security pipeline. To learn more, visit https://ASPSecurityKit.net/docs/the-security-pipeline/#authorization

Methods

IsAuthorized(requestService)

Summary

Authorizes the specified request. To learn more about the checks the default implementation performs, visit https://ASPSecurityKit.net/docs/the-security-pipeline/#authorization

Returns

AuthResult instance with Code as Success if authorization was successful; otherwise, a possible reason of failure.

Parameters
Name Type Description
requestService ASPSecurityKit.IRequestService The request service.
Exceptions
Type Description
System.ArgumentNullException When requestService is null.

HandleUnauthorizedRequest(requestService,result)

Summary

Handles response when request couldn’t be authorized.

Parameters
Name Type Description
requestService ASPSecurityKit.IRequestService The request service.
result ASPSecurityKit.AuthProviders.AuthResult The result instance with failure details.
Exceptions
Type Description
System.ArgumentNullException When requestService/result is null.
System.ArgumentException When result is not a failed one.

IsAuthorizedAsync(requestService)

Summary

Authorizes the specified request. To learn more about the checks the default implementation performs, visit https://ASPSecurityKit.net/docs/the-security-pipeline/#authorization

Returns

AuthResult instance with Code as Success if authorization was successful; otherwise, a possible reason of failure.

Parameters
Name Type Description
requestService ASPSecurityKit.IRequestService The request service.
Exceptions
Type Description
System.ArgumentNullException When requestService is null.

IsAuthorizedAsync(requestService,cancellationToken)

Summary

Authorizes the specified request. To learn more about the checks the default implementation performs, visit https://ASPSecurityKit.net/docs/the-security-pipeline/#authorization

Returns

AuthResult instance with Code as Success if authorization was successful; otherwise, a possible reason of failure.

Parameters
Name Type Description
requestService ASPSecurityKit.IRequestService The request service.
cancellationToken System.Threading.CancellationToken The cancellation token.
Exceptions
Type Description
System.ArgumentNullException When requestService is null.

HandleUnauthorizedRequestAsync(requestService,result)

Summary

Handles response when request couldn’t be authorized.

Parameters
Name Type Description
requestService ASPSecurityKit.IRequestService The request service.
result ASPSecurityKit.AuthProviders.AuthResult The result instance with failure details.
Exceptions
Type Description
System.ArgumentNullException When requestService/result is null.
System.ArgumentException When result is not a failed one.

HandleUnauthorizedRequestAsync(requestService,result,cancellationToken)

Summary

Handles response when request couldn’t be authorized.

Parameters
Name Type Description
requestService ASPSecurityKit.IRequestService The request service.
result ASPSecurityKit.AuthProviders.AuthResult The result instance with failure details.
cancellationToken System.Threading.CancellationToken The cancellation token.
Exceptions
Type Description
System.ArgumentNullException When requestService/result is null.
System.ArgumentException When result is not a failed one.