Require​Https​Attribute Require​Https​Attribute Class

Definition

An authorization filter that confirms requests are received over HTTPS.
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
public class RequireHttpsAttribute : Attribute, _Attribute, IAuthorizationFilter, IOrderedFilter, IFilterMetadata<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Method, Inherited:=True, AllowMultiple:=False)>
Public Class RequireHttpsAttribute
    Inherits Attribute
    Implements _Attribute, IAuthorizationFilter, IOrderedFilter, IFilterMetadata
Inheritance
System.ObjectSystem.Object
System.AttributeSystem.Attribute
RequireHttpsAttributeRequireHttpsAttribute
Attributes
System.AttributeUsageAttribute
Implements
System.Runtime.InteropServices._AttributeSystem.Runtime.InteropServices._Attribute IAuthorizationFilterIAuthorizationFilter IOrderedFilterIOrderedFilter IFilterMetadataIFilterMetadata

Inherited Members

System.Attribute

System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module)System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.Equals(System.Object)System.Attribute.Equals(System.Object)
System.Attribute.GetHashCode()System.Attribute.GetHashCode()
System.Attribute.Match(System.Object)System.Attribute.Match(System.Object)
System.Attribute.IsDefaultAttribute()System.Attribute.IsDefaultAttribute()
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfoCount(System.UInt32)System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfoCount(System.UInt32)
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfo(System.UInt32, System.UInt32, System.IntPtr)System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfo(System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.GetIDsOfNames(System.Guid, System.IntPtr, System.UInt32, System.UInt32, System.IntPtr)System.Attribute.System.Runtime.InteropServices._Attribute.GetIDsOfNames(System.Guid, System.IntPtr, System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.Invoke(System.UInt32, System.Guid, System.UInt32, System.Int16, System.IntPtr, System.IntPtr, System.IntPtr, System.IntPtr)System.Attribute.System.Runtime.InteropServices._Attribute.Invoke(System.UInt32, System.Guid, System.UInt32, System.Int16, System.IntPtr, System.IntPtr, System.IntPtr, System.IntPtr)
System.Attribute.TypeIdSystem.Attribute.TypeId

System.Object

System.Object.ToString()System.Object.ToString()
System.Object.Equals(System.Object, System.Object)System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()System.Object.GetType()
System.Object.MemberwiseClone()System.Object.MemberwiseClone()

Properties

Order Order

Gets the order value for determining the order of execution of filters. Filters execute in ascending numeric value of the Order property.
public int Order { get; set; }Public Property Order As Integer
Value
System.Int32 System.Int32

Remarks

Filters are executed in an ordering determined by an ascending sort of the Order property.

Asynchronous filters, such as IAsyncActionFilter, surround the execution of subsequent filters of the same filter kind. An asynchronous filter with a lower numeric Order value will have its filter method, such as OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate), executed before that of a filter with a higher value of Order.

Synchronous filters, such as IActionFilter, have a before-method, such as OnActionExecuting(ActionExecutingContext), and an after-method, such as OnActionExecuted(ActionExecutedContext). A synchronous filter with a lower numeric Order value will have its before-method executed before that of a filter with a higher value of Order. During the after-stage of the filter, a synchronous filter with a lower numeric Order value will have its after-method executed after that of a filter with a higher value of Order.

If two filters have the same numeric value of Order, then their relative execution order is determined by the filter scope.

Permanent Permanent

Specifies whether a permanent redirect, 301 Moved Permanently, should be used instead of a temporary redirect, 302 Found.
public bool Permanent { get; set; }Public Property Permanent As Boolean
Value
System.Boolean System.Boolean

Methods

HandleNonHttpsRequest(AuthorizationFilterContext) HandleNonHttpsRequest(AuthorizationFilterContext)

Called from OnAuthorization(AuthorizationFilterContext) if the request is not received over HTTPS. Expectation is Result will not be null after this method returns.
protected virtual void HandleNonHttpsRequest(AuthorizationFilterContext filterContext)Protected Overridable Sub HandleNonHttpsRequest(filterContext As AuthorizationFilterContext)
Parameters

Remarks

If it was a GET request, default implementation sets Result to a result which will redirect the client to the HTTPS version of the request URI. Otherwise, default implementation sets Result to a result which will set the status code to 403 (Forbidden).

OnAuthorization(AuthorizationFilterContext) OnAuthorization(AuthorizationFilterContext)

Called early in the filter pipeline to confirm request is authorized. Confirms requests are received over HTTPS. Takes no action for HTTPS requests. Otherwise if it was a GET request, sets Result to a result which will redirect the client to the HTTPS version of the request URI. Otherwise, sets Result to a result which will set the status code to 403 (Forbidden).
public virtual void OnAuthorization(AuthorizationFilterContext filterContext)Public Overridable Sub OnAuthorization(filterContext As AuthorizationFilterContext)
Parameters