Login.gov Token API

Token exchange using private_key_jwt or PKCE.

Operations 1

POST /api/openid_connect/token Exchange Authorization Code for Tokens #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/login-gov-token-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

login-gov-token-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Login.gov OpenID Connect Authentication Token API
  version: 2026-01
  description: 'Login.gov is the U.S. federal government''s secure single sign-on service for public-facing

    government applications, operated by the General Services Administration''s Technology

    Transformation Services. This OpenAPI describes the OpenID Connect (OIDC) integration

    surface used by relying parties (service providers) to authenticate users at IAL1 (auth

    only) and IAL2 (identity-verified) assurance levels.


    Login.gov conforms to the iGov OpenID Connect Profile. Implicit flow is not supported.

    Client authentication uses private_key_jwt (preferred for web apps) or PKCE

    (preferred for native mobile apps).

    '
  contact:
    name: Login.gov Partner Support
    url: https://developers.login.gov
    email: partners@login.gov
  license:
    name: Public Domain (U.S. Government Work)
    url: https://www.usa.gov/government-works
servers:
- url: https://idp.int.identitysandbox.gov
  description: Sandbox (integration) environment
- url: https://secure.login.gov
  description: Production environment
tags:
- name: Token
  description: Token exchange using private_key_jwt or PKCE.
paths:
  /api/openid_connect/token:
    post:
      tags:
      - Token
      summary: Exchange Authorization Code for Tokens
      operationId: exchangeToken
      description: 'Exchanges the authorization code for an `access_token` and a signed `id_token`. Web apps

        authenticate using `private_key_jwt`; native apps use PKCE with a `code_verifier`.

        '
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TokenRequest'
      responses:
        '200':
          description: Token response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TokenRequest:
      type: object
      required:
      - grant_type
      - code
      properties:
        grant_type:
          type: string
          enum:
          - authorization_code
        code:
          type: string
          description: Authorization code returned from `/openid_connect/authorize`.
        client_assertion_type:
          type: string
          description: Required for private_key_jwt clients.
          enum:
          - urn:ietf:params:oauth:client-assertion-type:jwt-bearer
        client_assertion:
          type: string
          description: Signed JWT (RS256) where `iss` and `sub` are `client_id`, `aud` is the token endpoint, and `jti`, `iat`, `exp` are set. Minimum 2048-bit key.
        code_verifier:
          type: string
          description: PKCE code verifier matching the original `code_challenge`. Used by native apps in lieu of `client_assertion`.
    Error:
      type: object
      properties:
        error:
          type: string
        error_description:
          type: string
    TokenResponse:
      type: object
      properties:
        access_token:
          type: string
          description: Opaque bearer token for the userinfo endpoint.
        token_type:
          type: string
          example: Bearer
        expires_in:
          type: integer
          description: Lifetime of the access token in seconds.
        id_token:
          type: string
          description: Signed JWT (RS256) carrying authenticated user identity claims.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque