---
title: "Login using OpenID."
method: POST
path: "/api/v2/Authentication/OAuthUser"
tags: ["Authentication"]
---

# Login using OpenID.

`POST /api/v2/Authentication/OAuthUser`

## Request

- Base URL: `https://secure.agco-ats.com`
- URL: `https://secure.agco-ats.com/api/v2/Authentication/OAuthUser`
- Auth: none declared

Exchange an either an authorization code or a refresh token for an access token. Usage of refresh token requires authentication.

## Request body

- APIModelsOAuthTokenParams: Either 'code' or 'refresh_token' is required.
  - `code` string: Authorization Code from OIDC provider.
  - `code_verifier` string: Required if PKCE is used. Value from which code_challenge was generated.
  - `refresh_token` string: Refresh Token from OIDC provider.

## Response `200`

OK

- APIModelsAuthenticatedUser
  - `UserID` integer: The user ID
  - `Name` string: The user's name
  - `Username` string: The username used for authentication
  - `Email` string: The user's email address
  - `Token` string: The token to use for API access
  - `MACToken` string: The MAC token to use for API access
  - `MACId` string: The MAC identifier to use for API access
  - `ExpiresIn` integer: How long the access token is valid, in seconds.
  - `RefreshToken` string: A refresh token used to request an updated Access Token.

## Changes

- **2026-02-08** `375dfaeb5a29`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agco-ats/apis/agco-ats-api/changes/api/v2/Authentication/OAuthUser/post.md)

---

[API](https://skmtc.dev/agco-ats/apis/agco-ats-api.md) - [All operations](https://skmtc.dev/agco-ats/apis/agco-ats-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agco-ats/apis/agco-ats-api/revisions/8b416443df5c?raw)
