Edit

Share via


ClientCredentialsSecurityTokenManager Class

Definition

Manages security tokens for the client.

C#
public class ClientCredentialsSecurityTokenManager : System.IdentityModel.Selectors.SecurityTokenManager
Inheritance
ClientCredentialsSecurityTokenManager
Derived

Examples

The following code shows how you can override this class to create a custom Client Credentials Security Token Manager.

C#
internal class MyClientCredentialsSecurityTokenManager :
    ClientCredentialsSecurityTokenManager
{
    MyClientCredentials credentials;

    public MyClientCredentialsSecurityTokenManager(MyClientCredentials credentials)
        : base(credentials)
    {
        this.credentials = credentials;
    }

    public override SecurityTokenProvider CreateSecurityTokenProvider(
        SecurityTokenRequirement tokenRequirement)
    {
        // Return your implementation of the SecurityTokenProvider, if required.
        // This implementation delegates to the base class.
        return base.CreateSecurityTokenProvider(tokenRequirement);
    }

    public override SecurityTokenAuthenticator CreateSecurityTokenAuthenticator(
        SecurityTokenRequirement tokenRequirement, out SecurityTokenResolver outOfBandTokenResolver)
    {
        // Return your implementation of the SecurityTokenAuthenticator, if required.
        // This implementation delegates to the base class.
        return base.CreateSecurityTokenAuthenticator(tokenRequirement, out outOfBandTokenResolver);
    }

    public override SecurityTokenSerializer CreateSecurityTokenSerializer(SecurityTokenVersion version)
    {
        // Return your implementation of the SecurityTokenSerializer, if required.
        // This implementation delegates to the base class.
        return base.CreateSecurityTokenSerializer(version);
    }
}

Remarks

This class handles security token serialization, security token provision and security token authentication for the client. There is one instance of this class for each client channel factory.

Constructors

Properties

ClientCredentials

Gets the client credentials.

Methods

CreateSecurityTokenAuthenticator(SecurityTokenRequirement, SecurityTokenResolver)

Creates a security token authenticator.

CreateSecurityTokenProvider(SecurityTokenRequirement)

Creates a security token provider.

CreateSecurityTokenSerializer(SecurityTokenVersion)

Creates a security token serializer.

CreateSecurityTokenSerializer(SecurityVersion)

Creates a security token serializer.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
IsIssuedSecurityTokenRequirement(SecurityTokenRequirement)

Gets a value that indicates whether the specified token requirement is an issued security token requirement.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)