Show / Hide Table of Contents

Class CredentialsManager

Manages IUserCredentialPlugin instances.

Inheritance
object
CredentialsManager
Implements
ICredentialsManager
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.Security
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public class CredentialsManager : ICredentialsManager

Constructors

CredentialsManager()

Manages IUserCredentialPlugin instances.

Declaration
public CredentialsManager()

Methods

GetAllInstalledPluginNames()

Return a list of all credential plugins that are available (including those that . i.e. all plugins that are installed are returned, including those without a corresponding license.

Declaration
public string[] GetAllInstalledPluginNames()
Returns
Type Description
string[]

List of all ICredntialPlugin names e.g: "ActiveDirectory", "CRM5/PASSWORD"

GetAllPlugins()

Return a list of all credential plugins that are licensed and available. i.e. some plugins that are installed may not be present, because the corresponding license is not present.

Declaration
public Dictionary<string, IUserCredentialPlugin> GetAllPlugins()
Returns
Type Description
Dictionary<string, IUserCredentialPlugin>

Dictionary of plugin name to plugin instance. e.g: "ActiveDirectory"=ActiveDirectoryCredentialPlugin

GetDefaultCredentialPlugin(UserType, int)

Manages IUserCredentialPlugin instances.

Declaration
public IUserCredentialPlugin GetDefaultCredentialPlugin(UserType userType, int personId)
Parameters
Type Name Description
UserType userType
int personId
Returns
Type Description
IUserCredentialPlugin

GetPlugin(string)

Get the plugin associated with a given credential type.

Declaration
public IUserCredentialPlugin GetPlugin(string credentialType)
Parameters
Type Name Description
string credentialType

Name of credential plugin: "CRM5/PASSWORD" or "ActiveDirectory".

Returns
Type Description
IUserCredentialPlugin

Plugin interface, or null if plugin is not available/licensed.

GetUntrustedCredentialsAsync(string, int, CancellationToken)

Get a set of credentials for a specified associate

Declaration
public Task<UntrustedCredentials[]> GetUntrustedCredentialsAsync(string type, int associateId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string type

Type of credentials to retrieve

int associateId

Id of associate to retrieve credentials for

CancellationToken cancellationToken
Returns
Type Description
Task<UntrustedCredentials[]>

Arrow of populated credential objects. SecretValue is left blank for security purposes if associate is not authenticated user or a system user.

GetUntrustedCredentialsAsync(string, CancellationToken)

Get a set of credentials for authenticated associate

Declaration
public Task<UntrustedCredentials[]> GetUntrustedCredentialsAsync(string type, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string type

Type of credentials to retrieve

CancellationToken cancellationToken
Returns
Type Description
Task<UntrustedCredentials[]>

Arrow of populated credential objects.

Refresh()

Refresh the list of credential plugins. Useful if you have just loaded some new licenses.

Declaration
public void Refresh()

RemoveUntrustedCredentialsAsync(string, int, string, CancellationToken)

Remove a credentials entry for an associate

Declaration
public Task RemoveUntrustedCredentialsAsync(string type, int associateId, string publicValue, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string type

Type of credential(Ex: "imap", "smtp")

int associateId

Id of associate to remove for

string publicValue

PublicValue of credential to remove

CancellationToken cancellationToken
Returns
Type Description
Task

RemoveUntrustedCredentialsAsync(string, string, CancellationToken)

Remove a credentials entry for authenticated user

Declaration
public Task RemoveUntrustedCredentialsAsync(string type, string publicValue, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string type

Type of credential(Ex: "imap", "smtp")

string publicValue

PublicValue of credential to remove

CancellationToken cancellationToken
Returns
Type Description
Task

SaveUntrustedCredentialsAsync(string, UntrustedCredentials, CancellationToken)

Save credentials for authenticated associate

Declaration
public Task SaveUntrustedCredentialsAsync(string type, UntrustedCredentials credentials, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string type

Type of credential(Ex: "imap", "smtp")

UntrustedCredentials credentials

Credentials to save

CancellationToken cancellationToken
Returns
Type Description
Task

SaveUntrustedCredentialsAsync(string, int, UntrustedCredentials, CancellationToken)

Save credentials for a specified associate

Declaration
public Task SaveUntrustedCredentialsAsync(string type, int associateId, UntrustedCredentials credentials, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string type

Type of credential(Ex: "imap", "smtp")

int associateId

Id of associate to save for

UntrustedCredentials credentials

Credentials to save

CancellationToken cancellationToken
Returns
Type Description
Task

Implements

ICredentialsManager

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top