Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CredentialAttribute Class

 

Specifies the user name and password for ASP.NET sites that require basic authentication or Windows authentication. This class cannot be inherited.

Namespace:   Microsoft.VisualStudio.TestTools.UnitTesting.Web
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

System.Object
  System.Attribute
    Microsoft.VisualStudio.TestTools.UnitTesting.Web.CredentialAttribute

[<Sealed>]
[<AttributeUsageAttribute(AttributeTargets.Method, AllowMultiple = false)>]
type CredentialAttribute = 
    class
        inherit Attribute
    end

NameDescription
System_CAPS_pubmethodCredentialAttribute(String, String)

Initializes a new instance of the CredentialAttribute class with a user name and password needed to access the test Web site.

System_CAPS_pubmethodCredentialAttribute(String, String, String)

Initializes a new instance of the CredentialAttribute class with a user name, password and domain needed to access the test Web site.

NameDescription
System_CAPS_pubpropertyDomain

Gets the user's domain.

System_CAPS_pubpropertyPassword

Gets the user's password.

System_CAPS_pubpropertyTypeId

(Inherited from Attribute.)

System_CAPS_pubpropertyUserName

Gets the user's user name.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Attribute.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Attribute.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodIsDefaultAttribute()

(Inherited from Attribute.)

System_CAPS_pubmethodMatch(Object)

(Inherited from Attribute.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

If a site uses Windows Authentication, the supplied credentials will override the logged in user's credentials.

This attribute targets methods. Only one instance of this attribute may be applied to a method.

System_CAPS_cautionCaution

The password is stored in plain text in source code and in the compiled assembly. Restrict access to the source code and assembly to help protect this sensitive information.

For more information about how to use attributes, see Extending Metadata Using Attributes.

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: