This topic has not yet been rated - Rate this topic

SecurityTokenParameters Class

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

The SecurityTokenParameters type exposes the following members.

  Name Description
Protected method SecurityTokenParameters() Initializes a new instance of the SecurityTokenParameters class.
Protected method SecurityTokenParameters(SecurityTokenParameters) Initializes a new instance of the SecurityTokenParameters class from another instance.
Top
  Name Description
Protected property HasAsymmetricKey When implemented, gets a value that indicates whether the token has an asymmetric key.
Public property InclusionMode Gets or sets the token inclusion requirements.
Public property ReferenceStyle Gets or sets the token reference style.
Public property RequireDerivedKeys Gets or sets a value that indicates whether keys can be derived from the original proof keys.
Protected property SupportsClientAuthentication When implemented, gets a value that indicates whether the token supports client authentication.
Protected property SupportsClientWindowsIdentity When implemented, gets a value that indicates whether the token supports a Windows identity for authentication.
Protected property SupportsServerAuthentication When implemented, gets a value that indicates whether the token supports server authentication.
Top
  Name Description
Public method Clone Clones another instance of this instance of the class.
Protected method CloneCore Clones another instance of this instance of the class.
Protected method CreateKeyIdentifierClause Creates a key identifier clause for a token.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method InitializeSecurityTokenRequirement When implemented, initializes a security token requirement.
Protected method MatchesKeyIdentifierClause Gets a value that indicates whether a token matches a key identifier clause.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Displays a text representation of this instance of the class. (Overrides Object.ToString().)
Top

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");
        }
    }
}


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ