RequestSecurityToken 클래스

정의

보안 토큰을 요청하는 데 사용되는 wst:RequestSecurityToken 요소(RST)를 나타냅니다.

public ref class RequestSecurityToken : System::IdentityModel::Protocols::WSTrust::WSTrustMessage
public class RequestSecurityToken : System.IdentityModel.Protocols.WSTrust.WSTrustMessage
type RequestSecurityToken = class
    inherit WSTrustMessage
Public Class RequestSecurityToken
Inherits WSTrustMessage
상속
RequestSecurityToken

예제

이 항목에 사용 되는 코드 예제에서 가져온 것은 Custom Token 샘플입니다. 이 샘플에서는 간단한 웹 토큰 (SWT)의 처리를 사용 하도록 설정 하는 사용자 지정 클래스를 제공 하 고 SWT 토큰 서비스를 제공할 수 있는 패시브 STS 구현의 포함 되어 있습니다. STS에서 파생 된 클래스에서 구현 됩니다 SecurityTokenService합니다. 메서드 중 대부분을 SecurityTokenService 토큰 발급 파이프라인을 사용 하는 호출 되는 클래스를 RequestSecurityToken 한 경우 해당 매개 변수 개체입니다. 이 샘플 및 사용할 수 있는 다른 샘플에 대 한 WIF에 대 한 다운로드 위치에 대 한, 참조 WIF 코드 샘플 인덱스합니다.

다음 코드 예제에서는 SecurityTokenService.GetScope 메서드를 구현하는 방법을 보여 줍니다. 메서드는을 RequestSecurityToken 해당 매개 변수 중 하나 및이 매개 변수는 속성으로 되는 속성을 설정 하는 Scope 메서드에 의해 반환 되는 개체입니다.

// Certificate Constants
private const string SIGNING_CERTIFICATE_NAME = "CN=localhost";
private const string ENCRYPTING_CERTIFICATE_NAME = "CN=localhost";

private SigningCredentials _signingCreds;
private EncryptingCredentials _encryptingCreds;
// Used for validating applies to address, set to URI used in RP app of application, could also have been done via config
private string _addressExpected = "http://localhost:19851/";
/// <summary>
/// This method returns the configuration for the token issuance request. The configuration
/// is represented by the Scope class. In our case, we are only capable of issuing a token to a
/// single RP identity represented by the _encryptingCreds field.
/// </summary>
/// <param name="principal">The caller's principal</param>
/// <param name="request">The incoming RST</param>
/// <returns></returns>
protected override Scope GetScope(ClaimsPrincipal principal, RequestSecurityToken request)
{
    // Validate the AppliesTo address
    ValidateAppliesTo( request.AppliesTo );

    // Create the scope using the request AppliesTo address and the RP identity
    Scope scope = new Scope( request.AppliesTo.Uri.AbsoluteUri, _signingCreds );

    if (Uri.IsWellFormedUriString(request.ReplyTo, UriKind.Absolute))
    {
        if (request.AppliesTo.Uri.Host != new Uri(request.ReplyTo).Host)
            scope.ReplyToAddress = request.AppliesTo.Uri.AbsoluteUri;
        else
            scope.ReplyToAddress = request.ReplyTo;
    }
    else
    {
        Uri resultUri = null;
        if (Uri.TryCreate(request.AppliesTo.Uri, request.ReplyTo, out resultUri))
            scope.ReplyToAddress = resultUri.AbsoluteUri;
        else
            scope.ReplyToAddress = request.AppliesTo.Uri.ToString() ;
    }

    // Note: In this sample app only a single RP identity is shown, which is localhost, and the certificate of that RP is 
    // populated as _encryptingCreds
    // If you have multiple RPs for the STS you would select the certificate that is specific to 
    // the RP that requests the token and then use that for _encryptingCreds
    scope.EncryptingCredentials = _encryptingCreds;

    return scope;
}
/// <summary>
/// Validates the appliesTo and throws an exception if the appliesTo is null or appliesTo contains some unexpected address.
/// </summary>
/// <param name="appliesTo">The AppliesTo parameter in the request that came in (RST)</param>
/// <returns></returns>
void ValidateAppliesTo(EndpointReference appliesTo)
{
    if (appliesTo == null)
    {
        throw new InvalidRequestException("The appliesTo is null.");
    }

    if (!appliesTo.Uri.Equals(new Uri(_addressExpected)))
    {
        throw new InvalidRequestException(String.Format("The relying party address is not valid. Expected value is {0}, the actual value is {1}.", _addressExpected, appliesTo.Uri.AbsoluteUri));
    }
}

설명

Wst: requestsecuritytoken 요소 (메시지)에 매개 변수 및 보안 토큰 서비스 (STS)에서 보안 토큰을 요청 하는 데 사용 되는 속성을 포함 합니다. 메시지 (또는 요소)은 RST로 약어입니다. RequestSecurityToken 클래스 RST의 요소를 나타내는 속성을 포함 합니다. RST은 Ws-trust;에서 정의한 요청 바인딩 중 하나에 해당 하는 요청을 구성할 수 있습니다. 예를 들어 발급, 갱신 바인딩, 유효성 검사 바인딩에 바인딩이나 취소 바인딩. 대부분의 속성에는 RequestSecurityToken 특정 종류의 이러한 바인딩에 의해 정의 된 요청에만 존재 하는 요소에 해당 하는 클래스입니다. 특정 요청의 종류에 따라 RequestSecurityToken 개체가 나타내는 또는 표시 되는 특정 요청에 있는 매개 변수 개체의 일부 속성 수 null입니다.

STS는 wst: requestsecuritytokenresponse 요소 (RSTR)을 포함 하는 메시지의 요청에 대 한 응답을 반환 합니다. 이 메시지가 표시 됩니다는 RequestSecurityTokenResponse 클래스입니다.

이 클래스가 나타내는 요소에 대한 자세한 내용은 WS-Trust 2005년 2월, WS-Trust 1.3 또는 WS-Trust 1.4 시나리오에 적용되는 WS-Trust 사양을 참조하세요.

생성자

RequestSecurityToken()

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

RequestSecurityToken(String)

지정된 요청 형식을 사용하여 RequestSecurityToken 클래스의 새 인스턴스를 초기화합니다.

RequestSecurityToken(String, String)

지정된 요청 형식을 사용하여 RequestSecurityToken 클래스의 새 인스턴스를 초기화합니다.

속성

ActAs

요청자가 역할을 수행하려고 하는 ID에 대한 보안 토큰을 가져오거나 설정합니다.

AdditionalContext

요청에 대한 추가 컨텍스트 정보를 가져오거나 설정합니다.

AllowPostdating

wst:AllowPostdating 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
AppliesTo

wsp:AppliesTo 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
AuthenticationType

wst:AuthenticationType 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
BinaryExchange

wst:BinaryExchange 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
CancelTarget

WS-Trust 취소 요청에서 취소될 토큰을 가져오거나 설정합니다.

CanonicalizationAlgorithm

wst:CanonicalizationAlgorithm 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
Claims

클라이언트(요청자)가 요청한 클레임 형식을 가져옵니다.

ComputedKeyAlgorithm

계산된 키가 발급된 토큰에 사용되는 경우 사용할 원하는 알고리즘을 나타내는 URI를 가져옵니다.

Context

RST 또는 RSTR에 대한 Context 특성의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
Delegatable

발급된 토큰을 위임 가능으로 표시해야 하는지 여부를 지정하는 값을 가져오거나 설정합니다.

DelegateTo

발급된 토큰을 위임해야 하는 ID를 가져오거나 설정합니다.

Encryption

암호화할 때 사용할 키와 토큰의 정보를 가져오거나 설정합니다.

EncryptionAlgorithm

wst:EncryptionAlgorithm 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
EncryptWith

wst:EncryptWith 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
Entropy

wst:Entropy 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
Forwardable

발급된 토큰을 전달 가능으로 표시해야 하는지 여부를 지정하는 값을 가져오거나 설정합니다.

Issuer

wst:OnBehalfOf 토큰의 발급자를 가져오거나 설정합니다.

KeySizeInBits

RequestSecurityToken(RST) 메시지 내의 wst:KeySize 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
KeyType

RequestSecurityToken(RST) 메시지 내의 wst:KeyType 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
KeyWrapAlgorithm

wst:KeyWrapAlgorithm 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
Lifetime

RequestSecurityToken(RST) 메시지 내의 wst:Lifetime 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
OnBehalfOf

요청이 대신 이루어지는 ID의 토큰을 가져오거나 설정합니다.

Participants

발급된 토큰을 사용할 수 있는 권한이 부여된 참여자를 가져오거나 설정합니다.

ProofEncryption

증명 토큰을 암호화하는 데 사용하는 토큰을 가져오거나 설정합니다.

Properties

개체를 확장하기 위한 속성 모음을 가져옵니다.

(다음에서 상속됨 OpenObject)
Renewing

WS-Trust 갱신 요청에 대한 갱신 의미 체계를 가져오거나 설정합니다.

RenewTarget

WS-Trust 갱신 요청에서 갱신될 토큰을 가져오거나 설정합니다.

ReplyTo

신뢰 당사자에게 회신하는 데 사용할 주소를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
RequestType

wst:RequestType 요소를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
SecondaryParameters

요청자가 작성자가 아닌 매개 변수를 가져오거나 설정합니다.

SignatureAlgorithm

wst:SignatureAlgorithm 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
SignWith

wst:SignWith 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
TokenType

wst:TokenType 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
UseKey

wst:UseKey 요소의 콘텐츠를 가져오거나 설정합니다.

(다음에서 상속됨 WSTrustMessage)
ValidateTarget

WS-Trust 유효성 검사 요청에서 유효성을 검사할 토큰을 가져오거나 설정합니다.

메서드

Equals(Object)

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

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

기본 해시 함수로 작동합니다.

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

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

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

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

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

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

(다음에서 상속됨 Object)

적용 대상

추가 정보