# Check auth configuration


[API catalog](/reference/api/) · [Docker Engine overview](/reference/api/engine/version/v1.57/) · [Product manual](https://docs.docker.com/engine/) · [OpenAPI specification](/reference/api/engine/version/v1.57.yaml)

API version: 1.57





`POST /auth`

Validate credentials for a registry and, if available, get an identity
token for accessing the registry without password.


## Connection and access

[API connection and authentication guidance](/reference/api/engine/version/v1.57/#connection)


Server: `/v1.57`

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
null
```

## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request POST \
  --unix-socket "${DOCKER_SOCKET:-/var/run/docker.sock}" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "password": "xxxx",
  "serveraddress": "https://index.docker.io/v1/",
  "username": "hannibal"
}' \
  'http://localhost/v1.57/auth'
```



## Parameters

## Request and responses

### Request  application/json

Authentication to check


Schema:

```json
{
  "$ref": "#/components/schemas/AuthConfig"
}
```









Schema example:
```json
{
  "password": "xxxx",
  "serveraddress": "https://index.docker.io/v1/",
  "username": "hannibal"
}
```


### Response 200 application/json

An identity token was generated successfully.


Schema:

```json
{
  "$ref": "#/components/schemas/AuthResponse"
}
```










### Response 204 

No error

No response content is declared.











### Response 401 application/json

Auth error


Schema:

```json
{
  "$ref": "#/components/schemas/ErrorResponse"
}
```









Schema example:
```json
{
  "message": "Something went wrong."
}
```


### Response 500 application/json

Server error


Schema:

```json
{
  "$ref": "#/components/schemas/ErrorResponse"
}
```









Schema example:
```json
{
  "message": "Something went wrong."
}
```


## Complete operation contract

```json
{
  "description": "Validate credentials for a registry and, if available, get an identity\ntoken for accessing the registry without password.\n",
  "operationId": "SystemAuth",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AuthConfig"
        }
      }
    },
    "description": "Authentication to check",
    "x-codegen-request-body-name": "authConfig"
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/AuthResponse"
          }
        }
      },
      "description": "An identity token was generated successfully."
    },
    "204": {
      "description": "No error"
    },
    "401": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Auth error"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Server error"
    }
  },
  "summary": "Check auth configuration",
  "tags": [
    "System"
  ]
}
```

## Referenced schemas

- [#/components/schemas/AuthConfig](/reference/api/engine/version/v1.57/schemas/AuthConfig/)

- [#/components/schemas/AuthResponse](/reference/api/engine/version/v1.57/schemas/AuthResponse/)

- [#/components/schemas/ErrorResponse](/reference/api/engine/version/v1.57/schemas/ErrorResponse/)




