Class TwoFactorLoginService
Inheritance
System.Object
Assembly: cs.temp.dll.dll
Syntax
public class TwoFactorLoginService : ITwoFactorLoginService2
Constructors
TwoFactorLoginService(ITwoFactorLoginRepository, IScopeProvider, IEnumerable<ITwoFactorProvider>, IOptions<IdentityOptions>, IOptions<BackOfficeIdentityOptions>)
Declaration
[Obsolete("Use ctor with all params - This will be removed in v11")]
public TwoFactorLoginService(ITwoFactorLoginRepository twoFactorLoginRepository, IScopeProvider scopeProvider, IEnumerable<ITwoFactorProvider> twoFactorSetupGenerators, IOptions<IdentityOptions> identityOptions, IOptions<BackOfficeIdentityOptions> backOfficeIdentityOptions)
Parameters
Type |
Name |
Description |
ITwoFactorLoginRepository |
twoFactorLoginRepository |
|
IScopeProvider |
scopeProvider |
|
System.Collections.Generic.IEnumerable<ITwoFactorProvider> |
twoFactorSetupGenerators |
|
IOptions<IdentityOptions> |
identityOptions |
|
IOptions<BackOfficeIdentityOptions> |
backOfficeIdentityOptions |
|
TwoFactorLoginService(ITwoFactorLoginRepository, IScopeProvider, IEnumerable<ITwoFactorProvider>, IOptions<IdentityOptions>, IOptions<BackOfficeIdentityOptions>, ILogger<TwoFactorLoginService>)
Declaration
public TwoFactorLoginService(ITwoFactorLoginRepository twoFactorLoginRepository, IScopeProvider scopeProvider, IEnumerable<ITwoFactorProvider> twoFactorSetupGenerators, IOptions<IdentityOptions> identityOptions, IOptions<BackOfficeIdentityOptions> backOfficeIdentityOptions, ILogger<TwoFactorLoginService> logger)
Parameters
Type |
Name |
Description |
ITwoFactorLoginRepository |
twoFactorLoginRepository |
|
IScopeProvider |
scopeProvider |
|
System.Collections.Generic.IEnumerable<ITwoFactorProvider> |
twoFactorSetupGenerators |
|
IOptions<IdentityOptions> |
identityOptions |
|
IOptions<BackOfficeIdentityOptions> |
backOfficeIdentityOptions |
|
ILogger<TwoFactorLoginService> |
logger |
|
Methods
DeleteUserLoginsAsync(Guid)
Declaration
public async Task DeleteUserLoginsAsync(Guid userOrMemberKey)
Parameters
Type |
Name |
Description |
System.Guid |
userOrMemberKey |
|
Returns
DisableAsync(Guid, String)
Declaration
public async Task<bool> DisableAsync(Guid userOrMemberKey, string providerName)
Parameters
Type |
Name |
Description |
System.Guid |
userOrMemberKey |
|
System.String |
providerName |
|
Returns
Type |
Description |
Task<System.Boolean> |
|
DisableWithCodeAsync(String, Guid, String)
Declaration
public async Task<bool> DisableWithCodeAsync(string providerName, Guid userOrMemberKey, string code)
Parameters
Type |
Name |
Description |
System.String |
providerName |
|
System.Guid |
userOrMemberKey |
|
System.String |
code |
|
Returns
Type |
Description |
Task<System.Boolean> |
|
GenerateSecret()
Generates a new random unique secret.
Declaration
protected virtual string GenerateSecret()
Returns
Type |
Description |
System.String |
The random secret
|
GetAllProviderNames()
Declaration
public IEnumerable<string> GetAllProviderNames()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
GetEnabledTwoFactorProviderNamesAsync(Guid)
Declaration
public async Task<IEnumerable<string>> GetEnabledTwoFactorProviderNamesAsync(Guid userOrMemberKey)
Parameters
Type |
Name |
Description |
System.Guid |
userOrMemberKey |
|
Returns
Type |
Description |
Task<System.Collections.Generic.IEnumerable<System.String>> |
|
GetSecretForUserAndProviderAsync(Guid, String)
Declaration
public async Task<string> GetSecretForUserAndProviderAsync(Guid userOrMemberKey, string providerName)
Parameters
Type |
Name |
Description |
System.Guid |
userOrMemberKey |
|
System.String |
providerName |
|
Returns
Type |
Description |
Task<System.String> |
|
GetSetupInfoAsync(Guid, String)
Declaration
public async Task<object> GetSetupInfoAsync(Guid userOrMemberKey, string providerName)
Parameters
Type |
Name |
Description |
System.Guid |
userOrMemberKey |
|
System.String |
providerName |
|
Returns
Type |
Description |
Task<System.Object> |
|
IsTwoFactorEnabledAsync(Guid)
Declaration
public async Task<bool> IsTwoFactorEnabledAsync(Guid userOrMemberKey)
Parameters
Type |
Name |
Description |
System.Guid |
userOrMemberKey |
|
Returns
Type |
Description |
Task<System.Boolean> |
|
SaveAsync(TwoFactorLogin)
Declaration
public Task SaveAsync(TwoFactorLogin twoFactorLogin)
Parameters
Type |
Name |
Description |
TwoFactorLogin |
twoFactorLogin |
|
Returns
ValidateAndSaveAsync(String, Guid, String, String)
Declaration
public async Task<bool> ValidateAndSaveAsync(string providerName, Guid userOrMemberKey, string secret, string code)
Parameters
Type |
Name |
Description |
System.String |
providerName |
|
System.Guid |
userOrMemberKey |
|
System.String |
secret |
|
System.String |
code |
|
Returns
Type |
Description |
Task<System.Boolean> |
|
ValidateTwoFactorSetup(String, String, String)
Declaration
public bool ValidateTwoFactorSetup(string providerName, string secret, string code)
Parameters
Type |
Name |
Description |
System.String |
providerName |
|
System.String |
secret |
|
System.String |
code |
|
Returns
Type |
Description |
System.Boolean |
|