# OpenID connect

## Auth with openID

<mark style="color:green;">`POST`</mark> `https://api.directual.com/good/v4/auth`

#### Request Body

| Name          | Type   | Description                                                                              |
| ------------- | ------ | ---------------------------------------------------------------------------------------- |
| redirect\_uri | string | URL of the redirect page                                                                 |
| clientID      | string | openID client ID                                                                         |
| appID         | string | id of your app (go to API → API keys, create key (if there is none) and copy APP\_ID) ID |
| provider      | string | openid                                                                                   |
| code          | string | auth code after successful authentication                                                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "result":{
    "token": "8ba4aee8-f509-41d0-9c59-232e828a41a6",
    "username": "test",
    "role": ""
  },
  "status": "ok"
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
  "msg":"user or password incorrect",
  "status":"error"
}
```

{% endtab %}
{% endtabs %}

```
Copy
curl -X PUT -H "Content-Type: application/json" \ https://api.directual.com/good/v4/auth \
-d '{
  "appID":"de87a6f7-a1e5-4b31-9d13-37c842b259a",
  "provider": "openid"
  "code": "37c842b259a...",
  "clientID": "de87a6f7....",
  "redirect_uri": "http://mywebsite.app/login"
}'
```
