---
title: "Get Tokens By Code"
method: POST
path: "/get-tokens-by-code"
tags: ["developers"]
---

# Get Tokens By Code

`POST /get-tokens-by-code`

Get tokens by code

## Headers

- `Authorization` string
- `AuthorizationOxdId` string

## Request body

- object
  - `oxd_id` string, required
  - `code` string, required
  - `state` string, required
  - `authentication_method` string — if value is missed then basic authentication is used. Otherwise it's possible to set `private_key_jwt` value for Private Key authentication.
  - `algorithm` string — optional but is required if authentication_method=private_key_jwt. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512

## Response `200`

OK

- object
  - `access_token` string, required
  - `expires_in` integer, required
  - `id_token` string, required
  - `refresh_token` string, required
  - `id_token_claims` object, required

## Other responses

- `400` — Invalid parameters are provided to endpoint.
- `403` — Forbidden. Invalid access token provided in Authorization header.
- `500` — Internal error occured. Please check oxd-server.log file for details (usually located in /var/log/oxd-server/oxd-server.log).

---

[API](https://skmtc.net/gluufederation/apis/oxd-server.md) · [All operations](https://skmtc.net/gluufederation/apis/oxd-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gluufederation/oxd-server/versions/33ca9e18c54b/schema)
