Search Results for

    Show / Hide Table of Contents

    Class UserCredentialsEndpointBehaviorExtension

    Provides configuration extension element for an endpoint behavior that allows to populate the client User Name and Windows credentials from the configuration file. Note that providing clear text credentials in configuration file is not secure and must be used with configuration encryption option or for testing purposes only.

    Inheritance
    object
    ConfigurationElement
    ServiceModelConfigurationElement
    ServiceModelExtensionElement
    BehaviorExtensionElement
    UserCredentialsEndpointBehaviorExtension
    Inherited Members
    ServiceModelExtensionElement.CopyFrom(ServiceModelExtensionElement)
    ServiceModelExtensionElement.ConfigurationElementName
    ConfigurationElement.IsReadOnly()
    ConfigurationElement.Equals(object)
    ConfigurationElement.GetHashCode()
    ConfigurationElement.LockAttributes
    ConfigurationElement.LockAllAttributesExcept
    ConfigurationElement.LockElements
    ConfigurationElement.LockAllElementsExcept
    ConfigurationElement.LockItem
    ConfigurationElement.ElementInformation
    ConfigurationElement.CurrentConfiguration
    object.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Nevatech.Vsb.Repository.Services
    Assembly: Nevatech.Vsb.Repository.dll
    Syntax
    public sealed class UserCredentialsEndpointBehaviorExtension : BehaviorExtensionElement
    Remarks

    The sample configuration would look like the following:

    <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="UserCredentials"> <clientCredentials /> <userCredentials enableHttpPreAuthentication="true" encrypted="false"> <userName userName="user" password="password"/> <windows userName="user" password="password" domain="domain"/> </userCredentials> </behavior> </endpointBehaviors> </behaviors> <extensions> <behaviorExtensions> <add name="userCredentials" type="Nevatech.Vsb.Repository.Services.UserCredentialsEndpointBehaviorExtension, Nevatech.Vsb.Repository"/> </behaviorExtensions> </extensions> </system.serviceModel>

    Note that due to some internal WCF issue the <clientCredentials/> element must be present in the same behavior configuration element before <userCredentials/> element. However this is not required, if client credentials are set programmatically, as it is done, for example, in Sentinet.

    Constructors

    UserCredentialsEndpointBehaviorExtension()

    Declaration
    public UserCredentialsEndpointBehaviorExtension()

    Fields

    IsEncryptedElementName

    Name of the element representing the flag indicating that provided client credentials are encrypted.

    Declaration
    public const string IsEncryptedElementName = "encrypted"
    Field Value
    Type Description
    string

    PreAuthenticationEnabledElementName

    Name of the element representing the flag to control HTTP(S) Basic Pre-Authentication enablement in the configuration element.

    Declaration
    public const string PreAuthenticationEnabledElementName = "enableHttpPreAuthentication"
    Field Value
    Type Description
    string

    UserNameElementName

    Name of the element representing the user name credentials in the configuration element.

    Declaration
    public const string UserNameElementName = "userName"
    Field Value
    Type Description
    string

    WindowsElementName

    Name of the element representing the Windows credentials in the configuration element.

    Declaration
    public const string WindowsElementName = "windows"
    Field Value
    Type Description
    string

    Properties

    BehaviorType

    Gets the type of the configured endpoint behavior.

    Declaration
    public override Type BehaviorType { get; }
    Property Value
    Type Description
    Type
    Overrides
    BehaviorExtensionElement.BehaviorType

    IsEncrypted

    Gets or sets the flag indicating that provided client credentials are encrypted using Windows Data Protection API.

    Declaration
    [ConfigurationProperty("encrypted")]
    public bool IsEncrypted { get; set; }
    Property Value
    Type Description
    bool

    PreAuthenticationEnabled

    Gets or sets the flag indicating that client credentials should be passed to the server on the very first call without waiting for a negotiation challenge if HTTP Basic Authentication is used.

    Declaration
    [ConfigurationProperty("enableHttpPreAuthentication")]
    public bool PreAuthenticationEnabled { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    The actual username credentials can either be explicitly provided in the UserName property (first choice) or extracted from the existing ClientCredentials instance.

    Properties

    Gets collection of configuration element properties.

    Declaration
    protected override ConfigurationPropertyCollection Properties { get; }
    Property Value
    Type Description
    ConfigurationPropertyCollection
    Overrides
    ConfigurationElement.Properties

    UserName

    Gets the user name credentials configuration element.

    Declaration
    [ConfigurationProperty("userName")]
    public UserNameCredentialsElement UserName { get; }
    Property Value
    Type Description
    UserNameCredentialsElement

    Windows

    Gets the Windows credentials configuration element.

    Declaration
    [ConfigurationProperty("windows")]
    public WindowsCredentialsElement Windows { get; }
    Property Value
    Type Description
    WindowsCredentialsElement

    Methods

    CreateBehavior()

    Returns a new instance of the endpoint behavior.

    Declaration
    protected override object CreateBehavior()
    Returns
    Type Description
    object

    New configured instance of the endpoint behavior.

    Overrides
    BehaviorExtensionElement.CreateBehavior()

    Encrypt(string)

    Encrypts the provided string in order to be used with encrypted configuration.

    Declaration
    public static string Encrypt(string value)
    Parameters
    Type Name Description
    string value

    Value to be encrypted.

    Returns
    Type Description
    string

    Encrypted string suitable for using with encrypted configuration.

    In This Article
    Back to top Nevatech Sentinet 6.7 Online Documentation