X4 Produktdokumentation

TOTP One-Time Password Generator

This adapter generates a TOTP one-time password compatible with Google Authenticator and others tools.

Properties


Operation

Defines the operation executed by the adapter

Possible values:

  • GenerateSecret: Create a 20-byte BASE32 character string which can be used as a secret key for password generation or validation, or as base for a QR code image

  • GeneratePassword: Create a one-time password based on the secret key provided in the input XML document

  • VerifyPassword: Verify a one-time password in combination with the secret key – both provided in the input XML document

  • GenerateAuthenticatorQRCode:  Create a 512x512 px image (.png) based on the secret key provided in the input XML document

    This operation also uses the issuer and account parameters to annotate the QR code. This information will be visible when the code is scanned by Google Authenticator or a similar tool.


Parameters


Adapter

Main class of the adapter (Do not change!)

Possible values: de.softproject.x4.adapter.totpgenerator.TOTPGenerator: Main class (default)

issuer

Company or organization name issuing the one-time passwords

This parameter should be treated like a display name, since it will be shown in the authenticator app as provided, e.g. SoftProject GmbH


account

Account which is tied to the secret key – typically  a username or e-mail address

This parameter should be treated like a display name, since it will be shown in the authenticator app as provided, e.g. John Doe or john.doe@example.org


Status values


1

The operation was executed successfully.

-1

An error occurred during the operation's execution.

403

The password does not match, e.g. because the input structure is not well-formed

Input

The adapter expects different input structures depending on the selected operation.

  • Operation GenerateSecret:
    This operation doesn't require any input

  • Operation GeneratePassword:

    XML
    <Secret>
            <!-- 20-byte BASE32 character string -->
        </Secret>
    


  • Operation VerifyPassword:

    XML
     <TOTP>
            <Password>
                <!-- 6-digit number with leading zeroes -->
            </Password>
            <Secret>
                <!-- 20-byte BASE32 character string -->
            </Secret>
        </TOTP>
    


  • Operation GenerateAuthenticatorQRCode:

    XML
    <Secret>
    	<!-- 20-byte BASE32 character string -->
    </Secret>
    


Output

The adapter outputs different structures depending on the selected operation.

  • Operation GenerateSecret:

    XML
    <Secret>
    	<!-- 20-byte BASE32 character string -->
    </Secret>
    


  • Operation GeneratePassword:

    XML
     <Password>
            <!-- 6-digit number with leading zeroes -->
        </Password>
    


  • Operation VerifyPassword:

    XML
     <Ok description="The password matches."/>
                   <!-- or -->  
     <Error description="The password provided is incorrect."/>
    


  • Operation GenerateAuthenticatorQRCode:
    An image (.png) with the QR code is output.