# Curl 토큰 생성

### Token 인증

모든 요청은 HTTPS 기반이며 Token을 통해 인증합니다.&#x20;

사용자 이름과 비밀번호로 Token을 발급받습니다. Request에 사용자 이름과 비밀번호 대신에 Token을 사용합니다. Token에는 유효기간이 있으며, 그 이후에는 재발급이 필요합니다.

{% hint style="info" %}
요청 헤더의 `Authorization`에 `Bearer {{token}}`형식으로 사용하여야 API 사용이 가능합니다.
{% endhint %}

<details>

<summary>Window에 curl 설치하기 <a href="https://curl.se/">https://curl.se/</a></summary>

1. [https://curl.se](https://curl.se/) 접속 -> <mark style="color:blue;">Download</mark> 메뉴 클릭

&#x20;![](/files/wgfP35aYRqna5WVDdGZq)

2. 자신의OS 사양에 맞는 파일 다운로드

![](/files/964rTM0rtu9T4NRB005U)

3. 다운로드 파일 압축해제 후 <mark style="color:blue;">**curl.exe**</mark> 파일 설치

4. 작업창에서 <mark style="color:blue;">**sysdm.cpl**</mark>로 검색하여 <mark style="color:blue;">**시스템 속성**</mark> 열기&#x20;

![](/files/Fh6lkRHXPbnZymvFsxMz)

5. <mark style="color:blue;">**고급**</mark> 탭 > <mark style="color:blue;">**환경변수**</mark> > <mark style="color:blue;">**path**</mark> > <mark style="color:blue;">**편집**</mark>

![](/files/VVnMPnJ7qXuF9jJ1zh3N)

6. <mark style="color:blue;">**새로만들기**</mark>에 <mark style="color:blue;">**curl.exe 파일 경로**</mark> 추가 > <mark style="color:blue;">**확인**</mark>&#x20;

![](/files/TapYh5jNvQ1qq4R6KnrV)

7. cmd창에서 curl 사용 가능&#x20;

![](/files/IOFCLfHeVf2TvjGbJcxh)

</details>

### <mark style="color:red;">POST</mark>  Token 생성

<pre><code><a data-footnote-ref href="#user-content-fn-1">{{url}}</a>/v3/auth/tokens
</code></pre>

v3 인증을 위한 Access Token을 발급받는 인증 API입니다.\
인증 받은 `Token`은 요청 헤더에 `Authorization: Bearer {{token}}`으로 설정하여 보냅니다.

#### Headers

<table data-header-hidden><thead><tr><th width="206"></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td>Content-Type</td><td>application/json</td><td></td></tr></tbody></table>

#### PARAMS

<table data-header-hidden><thead><tr><th width="205"></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td>expiresIn</td><td>5d</td><td></td></tr></tbody></table>

#### Body raw

```
{
    "username": "test-username",
    "password": "test-password"
}
```

### <mark style="color:purple;">example.</mark> &#x20;

#### Request&#x20;

<pre data-title="Curl " data-overflow="wrap"><code>curl --location -g '<a data-footnote-ref href="#user-content-fn-2">{{url}}</a>/v3/auth/tokens' \
--header 'Content-Type: application/json' \
--data '{
    "username": "{{username}}",
    "password": "{{password}}",
    "expiresIn": "{{expiresIn}}"
}'
</code></pre>

#### &#x20;Response

{% hint style="info" %}

* <mark style="color:blue;">**{{url}}**</mark> : <https://api.lgcdn.com> 입력&#x20;
* <mark style="color:blue;">**{{username}}**</mark>, <mark style="color:blue;">**{{password}}**</mark> : adp에서 부여받은 ID와 PW 입력&#x20;
* <mark style="color:blue;">**{{expiresIn}} :**</mark> 1y , 5d, 2h, 1m 값 중 사용 가능&#x20;
  {% endhint %}

<figure><img src="/files/2sFrvwYuDDEUoZ0Gfs6F" alt=""><figcaption></figcaption></figure>

[^1]: {{url}}을 수정해서 사용하세요

[^2]: 수정해서 사용하세요.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual.lgucdn.com/open-api/cdn3.0-v3/curl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
