Show / Hide Table of Contents

# Class Credential

A Credential containing information needed to log into a resource. This is primarily defined as a unique CredentialId with an associated Password that's linked to it.

##### Inheritance

System.Object
Credential

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace:Microsoft.SqlTools.ServiceLayer.Credentials.Contracts

###### Assembly:Microsoft.SqlTools.ServiceLayer.dll

##### Syntax

    public class Credential

### Constructors

| Improve this Doc View Source

#### Credential()

Default Constructor

##### Declaration

    public Credential()

| Improve this Doc View Source

#### Credential(String)

Constructor used when only credentialId is known

##### Declaration

    public Credential(string credentialId)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | credentialId | CredentialId

| Improve this Doc View Source

#### Credential(String, String)

Constructor

##### Declaration

    public Credential(string credentialId, string password)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | credentialId | CredentialId
System.String | password | Password

### Properties

| Improve this Doc View Source

#### CredentialId

A unique ID to identify the credential being saved.

##### Declaration

    public string CredentialId { get; set; }

##### Property Value

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### Password

The Password stored for this credential.

##### Declaration

    public string Password { get; set; }

##### Property Value

Type | Description
--- | ---
System.String |

### Methods

| Improve this Doc View Source

#### ValidateForLookup(Credential)

Validates the credential has all the properties needed to look up the password

##### Declaration

    public static void ValidateForLookup(Credential credential)

##### Parameters

Type | Name | Description
--- | --- | ---
Credential | credential |

| Improve this Doc View Source

#### ValidateForSave(Credential)

Validates the credential has all the properties needed to save a password

##### Declaration

    public static void ValidateForSave(Credential credential)

##### Parameters

Type | Name | Description
--- | --- | ---
Credential | credential |