XdsObjects Help file
MedicalConnections.Security Namespace / ITlsClientSecurity Interface / ModifyCredentials Method
Details of the connection being made
Example



In This Topic
    ModifyCredentials Method (ITlsClientSecurity)
    In This Topic
    Overridable method to allow implementation of custom authentication arrangements
    Syntax
    Sub ModifyCredentials( _
       ByVal args As ModifyCredentialArgs _
    ) 
    Dim instance As ITlsClientSecurity
    Dim args As ModifyCredentialArgs
     
    instance.ModifyCredentials(args)
    void ModifyCredentials( 
       ModifyCredentialArgs args
    )
    void ModifyCredentials( 
       ModifyCredentialArgs^ args
    ) 

    Parameters

    args
    Details of the connection being made
    Remarks

    This provides an extensible and flexible method to allow the bindings to be modified - e.g. (in conjunction with ModifyBindings) the code in the example could be used to use Basic Authentication.

    All the implementations of this method in the intrinsic MedicalConnections.Security classes do nothing.

    Example
    class MySecurity 
    { 
        class MySecurity : TlsClientWindows 
        { 
            public override void ModifyBindings(ModifyBindingsArgs args) 
            { 
                foreach (BindingElement b in args.Bindings) 
                { 
                    if (b is HttpsTransportBindingElement) 
                        (b as HttpsTransportBindingElement).AuthenticationScheme = System.Net.AuthenticationSchemes.Basic; 
                }
            } 
     
            public override void ModifyCredentials(ModifyCredentialArgs args) 
            { 
                args.Credentials.UserName.UserName = "MyUserName"; 
                args.Credentials.UserName.Password = "MyPassword"; 
            } 
        } 
    }
    Requirements

    Target Platforms: 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

    See Also