IAdmMultifactorAuthenticationQueries

The IAdmMultifactorAuthenticationQueries interface used to perform queries related to time-based one-time password authentication.

Inheritance: IUnknown

Methods

  • Method

  • Description

  • GetTotpApplications()

  • Returns all mobile applications that are used for time-based one-time password authentication (e.g. during self-password reset or Web interface sign in).

Details

GetTotpApplications()

Returns all mobile applications that are used for time-based one-time password authentication (e.g. during self-password reset or Web interface sign in).

ADM_TOTPENROLLMENTAPPLICATION_ENUM[] GetTotpApplications()

Examples

The following code sample checks whether Google Authenticator is used for time-based one-time password authentication.

PowerShell
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

# Connect to the Adaxes service
$admNS = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$admService = $admNS.GetServiceDirectly("localhost")

# Get TOTP applications
$queries = $admService.GetRemoteObject("ADM_SERVICEOBJECTID_MULTIFACTORAUTHQUERIES")
$totpApplications = $queries.GetTotpApplications()

# Check if Google Authenticator is used
if($totpApplications -contains "ADM_TOTPENROLLMENTAPPLICATION_GOOGLE")
{
    Write-Host "Google Authenticator is used for TOTP authentication."
}
C#
using System;
using System.Linq;
using Softerra.Adaxes.Adsi;
using Softerra.Adaxes.Interop.Adsi;
using Softerra.Adaxes.Interop.Adsi.PersistentObjects;
class Program
{
    static void Main(string[] args)
    {
        // Connect to the Adaxes service
        var adsNS = new AdmNamespace();
        IAdmService admService = adsNS.GetServiceDirectly("localhost");

        // Get TOTP applications
        IAdmServiceObjectProvider admServiceObjectProvider = (IAdmServiceObjectProvider)admService;
        IAdmMultifactorAuthenticationQueries queries =
            (IAdmMultifactorAuthenticationQueries)admServiceObjectProvider.GetRemoteObject(
                ADM_SERVICEOBJECTID_ENUM.ADM_SERVICEOBJECTID_MULTIFACTORAUTHQUERIES);
        ADM_TOTPENROLLMENTAPPLICATION_ENUM[] totpApplications = queries.GetTotpApplications();

        // Check if Google Authenticator is used
        if (totpApplications.Contains(
            ADM_TOTPENROLLMENTAPPLICATION_ENUM.ADM_TOTPENROLLMENTAPPLICATION_GOOGLE))
        {
            Console.WriteLine("Google Authenticator is used for TOTP authentication.");
        }
    }
}

Requirements

Minimum required version: 2019.2