> ## 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.

# Configurar o autenticador depois do SSO

> Quando o tenant pede o segundo fator da Niadra além do provedor.



## OpenAPI

````yaml openapi/pt/control.json POST /v1/auth/sso/second-factor
openapi: 3.1.0
info:
  title: API de controle da Niadra
  version: '1'
  description: >-
    Tenants, projetos, fontes, chaves, pessoas, configuração e uso. Nunca recebe
    conteúdo de cliente.
servers:
  - url: https://control.api.niadra.com
security: []
paths:
  /v1/auth/sso/second-factor:
    post:
      summary: Configurar o autenticador depois do SSO
      description: >-
        A configuração do autenticador de quem entrou pelo SSO, quando o tenant
        pede o segundo fator da Niadra: o código de login e o valor guardado
        fazem o papel da senha.


        **Autenticação.** Sem autenticação.
      operationId: sso_second_factor_v1_auth_sso_second_factor_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SsoCodeRequest'
            example:
              code: bXktb25lLXRpbWUtc2lnbi1pbi1jb2Rl
              verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecondFactorOut'
              example:
                secret: JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP
                totp_uri: >-
                  otpauth://totp/Niadra:nina@acme.example?secret=JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP&issuer=Niadra&algorithm=SHA1&digits=6&period=30
          description: A chave para configurar o aplicativo autenticador.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: O pedido não bate com o contrato.
      security: []
components:
  schemas:
    SsoCodeRequest:
      additionalProperties: false
      properties:
        code:
          maxLength: 128
          minLength: 20
          title: Code
          type: string
        verifier:
          maxLength: 128
          minLength: 20
          title: Verifier
          type: string
      required:
        - code
        - verifier
      title: SsoCodeRequest
      type: object
    SecondFactorOut:
      additionalProperties: false
      properties:
        secret:
          description: A chave TOTP em base32, para digitar no aplicativo autenticador.
          title: Secret
          type: string
        totp_uri:
          description: O endereço otpauth:// da mesma chave, para um QR code.
          title: Totp Uri
          type: string
      required:
        - secret
        - totp_uri
      title: SecondFactorOut
      type: object
    Problem:
      additionalProperties: false
      description: >-
        Detalhes do problema no formato da RFC 9457; `code` vem do catálogo de
        erros versionado.
      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

````