RequireHttpsAttribute RequireHttpsAttribute Class

An authorization filter that confirms requests are received over HTTPS.

Syntax

Declaration

[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 Hierarchy

  • System.Object
    System.Object
  • System.Attribute
    System.Attribute
  • RequireHttpsAttribute
    RequireHttpsAttribute

Inherited Members

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

Properties summary

Specifies whether a permanent redirect, 301 Moved Permanently, should be used instead of a temporary redirect, 302 Found.

Methods summary

Called from OnAuthorization(AuthorizationFilterContext) if the request is not received over HTTPS. Expectation is Result will not be null after this method returns.
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).

Properties

  • Order
    Order
    public int Order { get; set; }Public Property Order As Integer

    Property Value

    • System.Int32
      System.Int32
  • 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

    Property 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

Details

Assembly

Microsoft.AspNetCore.Mvc.Core.dll