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

# GET /.well-known/jwks.json

> Obtener la clave pública RSA en formato JWKS

Retorna la clave pública del Auth Server en formato estándar [JSON Web Key Set (RFC 7517)](https://datatracker.ietf.org/doc/html/rfc7517). Las APIs cliente pueden usar este endpoint para verificar la firma de los JWT sin necesidad de una copia local de `public.pem`.

<Tip>
  La respuesta incluye el header `Cache-Control: public, max-age=3600`. Puedes cachear la respuesta por hasta 1 hora.
</Tip>

## Response

<ResponseField name="keys" type="array">
  Array de claves públicas activas.

  <Expandable title="Propiedades de cada clave">
    <ResponseField name="kty" type="string">
      Tipo de clave. Siempre `"RSA"`.
    </ResponseField>

    <ResponseField name="use" type="string">
      Uso de la clave. Siempre `"sig"` (firma).
    </ResponseField>

    <ResponseField name="alg" type="string">
      Algoritmo. Siempre `"RS256"`.
    </ResponseField>

    <ResponseField name="kid" type="string">
      Key ID. Identifica qué clave se usó para firmar. Coincide con el header `kid` del JWT.
    </ResponseField>

    <ResponseField name="n" type="string">
      Módulo RSA codificado en base64url.
    </ResponseField>

    <ResponseField name="e" type="string">
      Exponente RSA codificado en base64url. Normalmente `"AQAB"`.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -s https://auth.mipos.co.cr/.well-known/jwks.json | python3 -m json.tool
  ```

  ```php PHP theme={null}
  $jwks = json_decode(
      file_get_contents('https://auth.mipos.co.cr/.well-known/jwks.json'),
      true
  );
  // $jwks['keys'][0]['n'] = módulo RSA
  // $jwks['keys'][0]['kid'] = key ID
  ```

  ```javascript Node.js theme={null}
  const res = await fetch('https://auth.mipos.co.cr/.well-known/jwks.json');
  const jwks = await res.json();
  // jwks.keys[0].kid = key ID activo
  ```

  ```python Python theme={null}
  import requests

  jwks = requests.get('https://auth.mipos.co.cr/.well-known/jwks.json').json()
  # jwks['keys'][0]['kid'] = key ID activo
  ```
</RequestExample>

<ResponseExample>
  ```json 200 — JWKS theme={null}
  {
    "keys": [
      {
        "kty": "RSA",
        "use": "sig",
        "alg": "RS256",
        "kid": "key-2024-01",
        "n": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",
        "e": "AQAB"
      }
    ]
  }
  ```
</ResponseExample>
