# 3. 인증 완료정보 전달하기

{% hint style="warning" %}
**Deprecated**

이 문서는 더 이상 관리되지 않습니다.

[PortOne 개발자센터](https://developers.portone.io/)를 이용해주세요.
{% endhint %}

인증 프로세스가 완료되면 반환되는 응답 객체(<mark style="color:red;">**`rsp`**</mark>)의 인증 성공 여부에 따라 처리 로직을 **`callback`** 함수에 작성합니다. 요청이 성공했을 경우에 **인증번호(`imp_uid`)를 서버에 전달**하는 로직을 다음 예제를 참고하여 작성합니다. 인증 성공시 [**반환되는 값**](/docs/sdk/javascript-sdk/cft-rt.md)을 확인하세요

### 1. callback Data 전달 예제

{% tabs %}
{% tab title="JavaScript" %}
{% code title="client-side" %}

```javascript
IMP.certification({
    /* ...중략... */
  }, function (rsp) { // callback
    if (rsp.success) { // 인증 성공 시
      // jQuery로 HTTP 요청
      jQuery.ajax({
        url: "{서버의 인증 정보를 받는 endpoint}", 
        method: "POST",
        headers: { "Content-Type": "application/json" },
        data: { imp_uid: rsp.imp_uid }
      });
    } else {
      alert("인증에 실패하였습니다. 에러 내용: " +  rsp.error_msg);
    }
  });
```

{% endcode %}
{% endtab %}

{% tab title="JS ES Next" %}
{% code title="client-side" %}

```javascript
IMP.certification({
    /* ...중략... */
  }, rsp => { // callback
    if (rsp.success) { // 인증 성공 시
      // axios로 HTTP 요청
      axios({
        url: "{서버의 인증 정보를 받는 endpoint}", 
        method: "post",
        headers: { "Content-Type": "application/json" },
        data: { imp_uid: rsp.imp_uid }
      });
    } else {
      alert(\`인증에 실패하였습니다. 에러 내용: \${rsp.error_msg}\`);
    }
  });

```

{% endcode %}
{% endtab %}
{% endtabs %}

### 2. 리디렉션 전달 예제

`IMP.`<mark style="color:red;">**`certification`**</mark> 호출 시 설정한 `param.`\*\*`m_redirect_url`\*\*로 인증 정보와 함께 다음과 같이 리디렉션됩니다.

{% code title="Query String" %}

```uri
GET {m_redirect_url}?imp_uid={}&merchant_uid={본인인증 건의 merchant_uid}&success={true 또는 false}
```

{% endcode %}


---

# 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://portone.gitbook.io/docs/etc/phone/3..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.
