MvcSecurityFailureResponseHandler
Members
Namespace: ASPSecurityKit.Net
Assembly: ASPSecurityKit.Net.dll
Summary
Implements the ISecurityFailureResponseHandler for MVC actions and performs redirection to URL specified in INetSecuritySettings for corresponding errors, provided that the request is not IsApiRequest, the caller is a known browser (as determined by IsBrowser) and the URL to redirect to isn’t the same as the current URL.
Constructors
#ctor(securitySettings,browser)
Summary
Initializes a new instance of the MvcSecurityFailureResponseHandler class.
Parameters
Name | Type | Description |
---|---|---|
securitySettings | ASPSecurityKit.Net.INetSecuritySettings | The security settings. |
browser | ASPSecurityKit.IBrowser | The browser info object. |
Methods
HandleFailure(requestService,reason,failureDescription)
Summary
Handles response for a request that failed some security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.Net.INetRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.
HandleFailure(requestService,reason,failureDescription,errors)
Summary
Handles response for a request that failed security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.Net.INetRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
errors | System.Collections.Generic.List<AuthError> | The errors list with more details. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.
HandleFailure(requestService,reason,failureDescription)
Summary
Handles response for a request that failed some security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.IRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.
HandleFailure(requestService,reason,failureDescription,errors)
Summary
Handles response for a request that failed security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.IRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
errors | System.Collections.Generic.List<AuthError> | The errors list with more details. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.
HandleFailureAsync(requestService,reason,failureDescription)
Summary
Handles response for a request that failed some security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.Net.INetRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.
HandleFailureAsync(requestService,reason,failureDescription,cancellationToken)
Summary
Handles response for a request that failed some security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.Net.INetRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
cancellationToken | System.Threading.CancellationToken | The cancellation token. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.
HandleFailureAsync(requestService,reason,failureDescription,errors)
Summary
Handles response for a request that failed security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.Net.INetRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
errors | System.Collections.Generic.List<AuthError> | The errors list with more details. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.
HandleFailureAsync(requestService,reason,failureDescription,errors,cancellationToken)
Summary
Handles response for a request that failed security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.Net.INetRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
errors | System.Collections.Generic.List<AuthError> | The errors list with more details. |
cancellationToken | System.Threading.CancellationToken | The cancellation token. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.
HandleFailureAsync(requestService,reason,failureDescription)
Summary
Handles response for a request that failed some security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.IRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.
HandleFailureAsync(requestService,reason,failureDescription,cancellationToken)
Summary
Handles response for a request that failed some security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.IRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
cancellationToken | System.Threading.CancellationToken | The cancellation token. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.
HandleFailureAsync(requestService,reason,failureDescription,errors)
Summary
Handles response for a request that failed security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.IRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
errors | System.Collections.Generic.List<AuthError> | The errors list with more details. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.
HandleFailureAsync(requestService,reason,failureDescription,errors,cancellationToken)
Summary
Handles response for a request that failed security checks. Must return true if the failure has been handled (response was updated).
Returns
true
if the failure was handled; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
requestService | ASPSecurityKit.IRequestService | The request service. |
reason | ASPSecurityKit.OpResult | The cause of the failure. |
failureDescription | System.String | The failure description. |
errors | System.Collections.Generic.List<AuthError> | The errors list with more details. |
cancellationToken | System.Threading.CancellationToken | The cancellation token. |
Remarks
Note to implementers: If you return false
the default logic of outputting failureDescription
with appropriate status code will be executed.
whereas if you return true
, no action is taken assuming you have already done the needful.