> ## Documentation Index
> Fetch the complete documentation index at: https://docs.niadra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up the authenticator

> Returns the second-factor secret of a person who has not confirmed one, after the password.



## OpenAPI

````yaml openapi/en/control.json POST /v1/auth/second-factor
openapi: 3.1.0
info:
  title: Niadra control API
  version: '1'
  description: >-
    Tenants, projects, sources, keys, people, configuration and usage. It never
    receives customer content.
servers:
  - url: https://control.api.niadra.com
security: []
paths:
  /v1/auth/second-factor:
    post:
      summary: Set up the authenticator
      description: >-
        The authenticator enrollment, for a person whose login answered "second
        factor enrollment

        required": the password again, and the secret comes back. The first
        valid code at login confirms

        it; once confirmed, this answers 409.


        **Authentication.** No authentication.
      operationId: second_factor_v1_auth_second_factor_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SecondFactorRequest'
            example:
              email: ana@acme.example
              password: correct horse battery staple
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecondFactorOut'
              example:
                secret: JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP
                totp_uri: >-
                  otpauth://totp/Niadra:ana@acme.example?secret=JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP&issuer=Niadra&algorithm=SHA1&digits=6&period=30
          description: Successful Response
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security: []
components:
  schemas:
    SecondFactorRequest:
      additionalProperties: false
      properties:
        email:
          maxLength: 320
          minLength: 3
          title: Email
          type: string
        password:
          maxLength: 1024
          minLength: 1
          title: Password
          type: string
      required:
        - email
        - password
      title: SecondFactorRequest
      type: object
    SecondFactorOut:
      additionalProperties: false
      properties:
        secret:
          description: Base32 TOTP secret, for typing into an authenticator app.
          title: Secret
          type: string
        totp_uri:
          description: otpauth:// address of the same secret, for a QR code.
          title: Totp Uri
          type: string
      required:
        - secret
        - totp_uri
      title: SecondFactorOut
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object

````