Class ConnectionIdentity
- Namespace
- Cratis.Arc.Connections
- Assembly
- Cratis.Arc.Core.dll
Represents the identity a connection authenticates with.
public record ConnectionIdentity : IEquatable<ConnectionIdentity>
- Inheritance
-
ConnectionIdentity
- Implements
- Inherited Members
- Extension Methods
Remarks
Set either a user name and password, or an access token. An access token is used as an Entra ID token for SQL Server, as the password for PostgreSQL and as an OIDC token for MongoDB.
Constructors
ConnectionIdentity(ConnectionIdentity)
protected ConnectionIdentity(ConnectionIdentity original)
Parameters
originalConnectionIdentity
ConnectionIdentity(string?, string?, string?)
Represents the identity a connection authenticates with.
public ConnectionIdentity(string? UserName = null, string? Password = null, string? AccessToken = null)
Parameters
UserNamestringOptional user name.
PasswordstringOptional password.
AccessTokenstringOptional access token.
Remarks
Set either a user name and password, or an access token. An access token is used as an Entra ID token for SQL Server, as the password for PostgreSQL and as an OIDC token for MongoDB.
Properties
AccessToken
Optional access token.
public string? AccessToken { get; init; }
Property Value
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
Password
Optional password.
public string? Password { get; init; }
Property Value
UserName
Optional user name.
public string? UserName { get; init; }
Property Value
Methods
Deconstruct(out string?, out string?, out string?)
public void Deconstruct(out string? UserName, out string? Password, out string? AccessToken)
Parameters
Equals(ConnectionIdentity?)
public virtual bool Equals(ConnectionIdentity? other)
Parameters
otherConnectionIdentity
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Remarks
Never includes the password or the access token, so an identity can be logged.
Operators
operator ==(ConnectionIdentity?, ConnectionIdentity?)
public static bool operator ==(ConnectionIdentity? left, ConnectionIdentity? right)
Parameters
leftConnectionIdentityrightConnectionIdentity
Returns
operator !=(ConnectionIdentity?, ConnectionIdentity?)
public static bool operator !=(ConnectionIdentity? left, ConnectionIdentity? right)
Parameters
leftConnectionIdentityrightConnectionIdentity