FormsAuthenticationConfiguration.Protection 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
쿠키를 암호화하는 데 사용되는 암호화 유형을 가져오거나 설정합니다.
public:
property System::Web::Configuration::FormsProtectionEnum Protection { System::Web::Configuration::FormsProtectionEnum get(); void set(System::Web::Configuration::FormsProtectionEnum value); };
[System.Configuration.ConfigurationProperty("protection", DefaultValue=System.Web.Configuration.FormsProtectionEnum.All)]
public System.Web.Configuration.FormsProtectionEnum Protection { get; set; }
[<System.Configuration.ConfigurationProperty("protection", DefaultValue=System.Web.Configuration.FormsProtectionEnum.All)>]
member this.Protection : System.Web.Configuration.FormsProtectionEnum with get, set
Public Property Protection As FormsProtectionEnum
속성 값
열거형 값 중 FormsProtectionEnum 하나입니다. 기본값은 All입니다.
참고 데이터 유효성 검사와 암호화를 모두 사용하여 쿠키를 보호하려면 이 속성의 기본값을 사용해야 합니다. 이 옵션은 을 기반으로 구성된 데이터 유효성 검사 알고리즘을 machineKey사용합니다. Triple-DES(3DES)는 암호화에 사용되며, 사용 가능한 경우 키가 충분히 긴 경우(48바이트 이상)
쿠키 보호를 개선하기 위해 다음으로 설정할 RequireSSLtrue수도 있습니다.
- 특성
예제
다음 코드 예제에서는 속성에 액세스 하는 방법을 보여 있습니다 Protection . 섹션을 가져오는 방법을 알아보려면 클래스 항목의 FormsAuthenticationConfiguration 코드 예제를 참조하세요.
// Get the current Protection.
FormsProtectionEnum currentProtection =
formsAuthentication.Protection;
// Set the Protection property.
formsAuthentication.Protection =
FormsProtectionEnum.All;
' Get the current Protection.
Dim currentProtection As FormsProtectionEnum =
formsAuthentication.Protection
' Set the Protection property.
formsAuthentication.Protection = FormsProtectionEnum.All