MachineKeySessionSecurityTokenHandler 클래스

정의

구성 파일의 ASP.NET <machineKey> 요소에 지정된 서명 및 암호화 키를 사용하여 세션 토큰을 처리합니다.

public ref class MachineKeySessionSecurityTokenHandler : System::IdentityModel::Tokens::SessionSecurityTokenHandler
public class MachineKeySessionSecurityTokenHandler : System.IdentityModel.Tokens.SessionSecurityTokenHandler
type MachineKeySessionSecurityTokenHandler = class
    inherit SessionSecurityTokenHandler
Public Class MachineKeySessionSecurityTokenHandler
Inherits SessionSecurityTokenHandler
상속
MachineKeySessionSecurityTokenHandler

예제

다음 XML은 구성에서 ASP.NET <machineKey> 요소를 사용하여 서명 및 암호화 키를 명시적으로 지정하는 방법을 보여줍니다. 요소는 <machineKey> 구성 파일의 <system.web> 요소 아래에 지정됩니다.

<machineKey compatibilityMode="Framework45" decryptionKey="CC510D … 8925E6" validationKey="BEAC8 … 6A4B1DE" />  

다음 XML은 토큰 처리기 컬렉션에 MachineKeySessionSecurityTokenHandler 추가하는 방법을 보여줍니다. 기본값 SessionSecurityTokenHandler 은 먼저 컬렉션에서 제거됩니다. 토큰 처리기는 securityTokenHandlers 요소 아래에< 구성됩니다>.

<securityTokenHandlers>  
  <remove type="System.IdentityModel.Tokens.SessionSecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />  
  <add type="System.IdentityModel.Services.Tokens.MachineKeySessionSecurityTokenHandler, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />  
</securityTokenHandlers>  

설명

기본적으로 클래스는 SessionSecurityTokenHandler DPAPI(Data Protection API)를 사용하는 클래스를 사용하여 ProtectedDataCookieTransform 세션 토큰을 보호합니다. DPAPI는 사용자 또는 컴퓨터 자격 증명을 사용하여 보호를 제공하고 키 데이터를 사용자 프로필에 저장합니다. 즉, 한 컴퓨터에서 서명되고 암호화된 세션 토큰은 다른 컴퓨터에서 유효성을 검사하거나 암호 해독할 수 없습니다.

반면 클래스는 MachineKeySessionSecurityTokenHandler 구성 파일의 MachineKeyTransform 요소에 지정된 암호화 자료를 사용하여 세션 쿠키 데이터를 보호하는 클래스를 <machineKey> 사용합니다. 즉, 여러 컴퓨터에서 동일한 키(및 세션 토큰)를 사용할 수 있습니다. 이는 애플리케이션이 웹 팜에 배포될 때 특히 중요합니다. Windows Identity Foundation을 사용하여 웹 팜에 배포된 애플리케이션을 보호하는 방법에 대한 자세한 내용은 WIF 및 웹 팜 참조하세요.

토큰 처리기 컬렉션에 추가하여 애플리케이션을 MachineKeySessionSecurityTokenHandler 사용하도록 구성합니다. 이러한 처리기가 있는 경우 먼저 토큰 처리기 컬렉션에서 (또는 클래스에서 SessionSecurityTokenHandler 파생된 처리기)를 제거 SessionSecurityTokenHandler 해야 합니다. MachineKeySessionSecurityTokenHandler 이는 파생되고 SessionSecurityTokenHandler 토큰 처리기 컬렉션에 지정된 형식의 여러 처리기를 포함할 수 없기 때문입니다.

생성자

Name Description
MachineKeySessionSecurityTokenHandler()

MachineKeySessionSecurityTokenHandler 클래스의 새 인스턴스를 초기화합니다.

MachineKeySessionSecurityTokenHandler(TimeSpan)

지정된 기본 토큰 수명이 있는 클래스의 MachineKeySessionSecurityTokenHandler 새 인스턴스를 초기화합니다.

속성

Name Description
CanValidateToken

이 처리기가 형식 SessionSecurityToken의 토큰 유효성 검사를 지원하는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
CanWriteToken

이 처리기가 형식 SessionSecurityToken의 토큰을 쓸 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
Configuration

현재 인스턴스에 대한 구성을 SecurityTokenHandlerConfiguration 제공하는 개체를 가져오거나 설정합니다.

(다음에서 상속됨 SecurityTokenHandler)
ContainingCollection

현재 인스턴스를 포함하는 토큰 처리기 컬렉션을 가져옵니다.

(다음에서 상속됨 SecurityTokenHandler)
CookieElementName

쿠키 요소의 이름을 가져옵니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
CookieNamespace

쿠키 요소의 네임스페이스를 가져옵니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
TokenLifetime

토큰 수명을 가져오거나 설정합니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
TokenType

이 처리기가 처리하는 토큰의 형식을 가져옵니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
Transforms

쿠키에 적용할 변환을 가져옵니다.

(다음에서 상속됨 SessionSecurityTokenHandler)

메서드

Name Description
ApplyTransforms(Byte[], Boolean)

속성에서 지정한 Transforms 변환을 지정된 쿠키를 인코딩하거나 디코딩하도록 적용합니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
CanReadKeyIdentifierClause(XmlReader)

지정된 XML 판독기에서 참조하는 XML 요소가 이 인스턴스에서 역직렬화할 수 있는 키 식별자 절인지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 SecurityTokenHandler)
CanReadToken(String)

지정된 문자열을 이 인스턴스에서 처리하는 형식의 토큰으로 역직렬화할 수 있는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 SecurityTokenHandler)
CanReadToken(XmlReader)

판독기가 요소에 <wsc:SecurityContextToken> 배치되는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
CanWriteKeyIdentifierClause(SecurityKeyIdentifierClause)

지정된 키 식별자 절을 이 인스턴스에서 serialize할 수 있는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 SecurityTokenHandler)
CreateSecurityTokenReference(SecurityToken, Boolean)

파생 클래스에서 재정의되는 경우 해당 클래스에서 처리된 토큰에 대한 보안 토큰 참조를 만듭니다. 이 메서드는 일반적으로 STS(보안 토큰 서비스)에서 호출됩니다.

(다음에서 상속됨 SecurityTokenHandler)
CreateSessionSecurityToken(ClaimsPrincipal, String, String, DateTime, DateTime)

토큰이 SessionSecurityToken 유효한 동안 지정된 클레임 보안 주체 및 시간 범위를 기반으로 만듭니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
CreateToken(SecurityTokenDescriptor)

지정된 토큰 설명자를 기반으로 보안 토큰을 만듭니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
DetectReplayedToken(SecurityToken)

파생 클래스에서 재정의된 경우 지정된 토큰이 재생되는 것으로 감지되면 예외를 throw합니다.

(다음에서 상속됨 SecurityTokenHandler)
Equals(Object)

지정된 개체가 현재 개체와 같은지 여부를 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 사용됩니다.

(다음에서 상속됨 Object)
GetTokenTypeIdentifiers()

이 처리기에서 처리할 수 있는 토큰 형식에 대한 토큰 형식 URI를 가져옵니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
GetType()

현재 인스턴스의 Type 가져옵니다.

(다음에서 상속됨 Object)
LoadCustomConfiguration(XmlNodeList)

XML에서 사용자 지정 구성을 로드합니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
MemberwiseClone()

현재 Object단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ReadKeyIdentifierClause(XmlReader)

파생 클래스에서 재정의된 경우 지정된 XML 판독기에서 참조하는 XML을 파생 클래스에서 처리된 토큰을 참조하는 키 식별자 절로 역직렬화합니다.

(다음에서 상속됨 SecurityTokenHandler)
ReadToken(Byte[], SecurityTokenResolver)

SessionSecurityToken 지정된 토큰 확인자를 사용하여 바이트 스트림에서 읽습니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
ReadToken(String)

파생 클래스에서 재정의되는 경우 지정된 문자열을 파생 클래스에서 처리된 형식의 토큰으로 역직렬화합니다.

(다음에서 상속됨 SecurityTokenHandler)
ReadToken(XmlReader, SecurityTokenResolver)

SessionSecurityToken 지정된 XML 판독기 및 토큰 확인자를 사용하여 읽습니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
ReadToken(XmlReader)

지정된 XML 판독기를 SessionSecurityToken 사용하여 읽습니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
SetTransforms(IEnumerable<CookieTransform>)

쿠키에 적용할 변환을 설정합니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)
TraceTokenValidationFailure(SecurityToken, String)

추적을 사용할 때 보안 토큰의 유효성을 검사하는 동안 오류 이벤트를 추적합니다.

(다음에서 상속됨 SecurityTokenHandler)
TraceTokenValidationSuccess(SecurityToken)

추적을 사용할 때 보안 토큰 이벤트의 유효성 검사를 성공적으로 추적합니다.

(다음에서 상속됨 SecurityTokenHandler)
ValidateSession(SessionSecurityToken)

지정된 토큰과 연결된 세션이 여전히 유효한지 여부를 확인합니다. 유효성은 지정된 토큰의 ValidFrom 속성과 ValidTo 속성을 확인하여 결정됩니다. 세션이 더 이상 유효하지 않으면 예외가 throw됩니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
ValidateToken(SecurityToken)

지정된 토큰의 유효성을 검사하고 해당 클레임을 반환합니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
ValidateToken(SessionSecurityToken, String)

지정된 세션 토큰의 유효성을 검사하고 해당 클레임을 반환합니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
WriteKeyIdentifierClause(XmlWriter, SecurityKeyIdentifierClause)

파생 클래스에서 재정의되는 경우 지정된 키 식별자 절을 XML로 serialize합니다. 키 식별자 절은 파생 클래스에서 지원하는 형식이어야 합니다.

(다음에서 상속됨 SecurityTokenHandler)
WriteToken(SecurityToken)

파생 클래스에서 재정의되는 경우 지정된 보안 토큰을 문자열로 serialize합니다. 토큰은 파생 클래스에서 처리하는 형식이어야 합니다.

(다음에서 상속됨 SecurityTokenHandler)
WriteToken(SessionSecurityToken)

지정된 토큰을 바이트 배열로 직렬화합니다.

(다음에서 상속됨 SessionSecurityTokenHandler)
WriteToken(XmlWriter, SecurityToken)

지정된 XML 기록기를 사용하여 지정된 토큰을 serialize합니다.

(다음에서 상속됨 SessionSecurityTokenHandler)

적용 대상

추가 정보