Windows apps
Collapse the table of content
Expand the table of content

SecurityTokenParameters Class

 

Specifies an abstract class that when implemented represents security token parameters.

Namespace:   System.ServiceModel.Security.Tokens
Assembly:  System.ServiceModel (in System.ServiceModel.dll)


public abstract class SecurityTokenParameters

NameDescription
System_CAPS_protmethodSecurityTokenParameters()

Initializes a new instance of the SecurityTokenParameters class.

System_CAPS_protmethodSecurityTokenParameters(SecurityTokenParameters)

Initializes a new instance of the SecurityTokenParameters class from another instance.

NameDescription
System_CAPS_protpropertyHasAsymmetricKey

When overridden in a derived class, gets a value that indicates whether the token has an asymmetric key.

System_CAPS_pubpropertyInclusionMode

Gets or sets the token inclusion requirements.

System_CAPS_pubpropertyReferenceStyle

Gets or sets the token reference style.

System_CAPS_pubpropertyRequireDerivedKeys

Gets or sets a value that indicates whether keys can be derived from the original proof keys.

System_CAPS_protpropertySupportsClientAuthentication

When overridden in a derived class, gets a value that indicates whether the token supports client authentication.

System_CAPS_protpropertySupportsClientWindowsIdentity

When overridden in a derived class, gets a value that indicates whether the token supports a Windows identity for authentication.

System_CAPS_protpropertySupportsServerAuthentication

When overridden in a derived class, gets a value that indicates whether the token supports server authentication.

NameDescription
System_CAPS_pubmethodClone()

Clones another instance of this instance of the class.

System_CAPS_protmethodCloneCore()

Clones another instance of this instance of the class.

System_CAPS_protmethodCreateKeyIdentifierClause(SecurityToken, SecurityTokenReferenceStyle)

Creates a key identifier clause for a token.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodInitializeSecurityTokenRequirement(SecurityTokenRequirement)

When overridden in a derived class, initializes a security token requirement.

System_CAPS_protmethodMatchesKeyIdentifierClause(SecurityToken, SecurityKeyIdentifierClause, SecurityTokenReferenceStyle)

Indicates whether a token matches a key identifier clause.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Displays a text representation of this instance of the class.(Overrides Object.ToString().)

Security token parameters provide information about the tokens (for example, token type, issuer, and so on) required by the security binding element.

The security token parameter classes derived from this one are a collection of token properties and methods, and are used in creating different kinds of security binding elements and tokens. Not all of the properties are relevant to all derived classes. For example, the ReferenceStyle has no relevance in an issued token (SAML token) case.

The following code shows a custom override of this class called CreditCardTokenParameters.

public class CreditCardTokenParameters : SecurityTokenParameters
{
    public CreditCardTokenParameters()
    {
    }

    protected CreditCardTokenParameters(CreditCardTokenParameters other)
        : base(other)
    {
    }

    protected override SecurityTokenParameters CloneCore()
    {
        return new CreditCardTokenParameters(this);
    }

    protected override void InitializeSecurityTokenRequirement(SecurityTokenRequirement requirement)
    {
        requirement.TokenType = Constants.CreditCardTokenType;
        return;
    }

    // A credit card token has no cryptography, no windows identity, and supports only client authentication.
    protected override bool HasAsymmetricKey 
    { 
        get { return false; } 
    }

    protected override bool SupportsClientAuthentication 
    { 
        get { return true; } 
    }

    protected override bool SupportsClientWindowsIdentity 
    { 
        get { return false; } 
    }

    protected override bool SupportsServerAuthentication 
    { 
        get { return false; } 
    }

    protected override SecurityKeyIdentifierClause CreateKeyIdentifierClause(SecurityToken token, SecurityTokenReferenceStyle referenceStyle)
    {
        if (referenceStyle == SecurityTokenReferenceStyle.Internal)
        {
            return token.CreateKeyIdentifierClause<LocalIdKeyIdentifierClause>();
        }
        else
        {
            throw new NotSupportedException("External references are not supported for credit card tokens");
        }
    }
}

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft