Class Credentials
Used to persist credentials.
Namespace: Neon.Common
Assembly: Neon.Common.dll
Syntax
public class Credentials
Remarks
Two forms of credentials are currently supported: a standalone security token or API key or the combination of a username and password.
Constructors
Credentials()
Constructor.
Declaration
public Credentials()
Properties
HasToken
Returns true
if the credentials hold a Token.
Declaration
public bool HasToken { get; }
Property Value
Type | Description |
---|---|
bool |
HasUsernamePassword
Declaration
public bool HasUsernamePassword { get; }
Property Value
Type | Description |
---|---|
bool |
Password
The password (use in conjunction with Username).
Declaration
public string Password { get; set; }
Property Value
Type | Description |
---|---|
string |
Token
The security token.
Declaration
public string Token { get; set; }
Property Value
Type | Description |
---|---|
string |
Username
The username (use in conjunction with Password).
Declaration
public string Username { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
FromToken(string)
Constructs credentials from a token.
Declaration
public static Credentials FromToken(string token)
Parameters
Type | Name | Description |
---|---|---|
string | token | The token. |
Returns
Type | Description |
---|---|
Credentials | The Credentials. |
FromUserPassword(string, string)
Constructs credentials from a token.
Declaration
public static Credentials FromUserPassword(string username, string password)
Parameters
Type | Name | Description |
---|---|---|
string | username | The username. |
string | password | The password. |
Returns
Type | Description |
---|---|
Credentials | The Credentials. |