---
# System prepended metadata

title: Eauth

---

# Eauth

## API

### Base Url:
```
https://api-dev.evaly.com.bd/eauth
```

## Oauth endpoints:

### Get auth code 

- `Description:`
 This api creates auth code for oauth flow. 


- `Endpoint` : `/api/v1/oauth/code`

- `Method` : `GET`

- `Headers` :
     - `Authentication` `<your bearer token here>`

- `Query Parameters` :
    - `redirect_uri`: Required. It has to be registered with eauth server.
    - `code_challenge`: Required. Value should be according to the `code_challenge_method` query parameter method.
    - `code_challenge_method`: Optional. Currently two method supported: `plain` and `s256`. Default value will be `plain`.
        - `plain`: `code_challenge` will be plain text and it is same as the `code_verifier`.
        - `s256`: `code_challenge` will be hexadecimal encoded value of the `code_verifier`. For example: for `code_verifier=test`, it will be `code_challenge=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08`

- `Request Body` : n/a

- `Response Body` :
```json=
{
  "message": "Get auth code is successful",
  "success": true,
  "data": {
    "code": "ccc12ae9-3c82-4807-8d43-5f422120fa8e"
  }
}
```

### Get access and refresh tokens using auth code

- `Description:`
 This api creates auth code for oauth flow. 


- `Endpoint` : `/api/v1/oauth/token`

- `Method` : `GET`

- `Headers` : n/a

- `Query Parameters` :
    - `code`: Required. It is the auth code.
    - `code_verifier`: Required. It is the text used for the `code_challenge`.

- `Request Body` : n/a

- `Response Body` :
```json=
{
  "message": "Get tokens is successful",
  "success": true,
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IjAxODIxMTgyMDk1IiwiZ3JvdXBzIjpbXSwiZmlyc3RfbmFtZSI6Ik1kIE51cmUgQWxhbSIsImxhc3RfbmFtZSI6Ik5haGlkIiwiaXNfc3RhZmYiOmZhbHNlLCJpc19hY3RpdmUiOnRydWUsImlzX3N1cGVydXNlciI6ZmFsc2UsInZlcmlmaWVkIjp0cnVlLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsInVzZXJfc3RhdHVzIjoiYWN0aXZlIi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