# 2. 본인인증창 호출하기

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

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

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

휴대폰 본인인증은 아래 두가지 방법으로 호출할 수 있습니다.

> **팝업**(Default) 방식
>
> 휴대폰 본인인증 팝업창이 열리고 본인인증를 완료하면 두 번째 인자로 지정된 `callback` 함수가 실행됩니다.

> **리디렉션**(redirect)방식(**Mobile** 환경에서만 적용)
>
> 모바일 환경에서 `param.popup`을 <mark style="color:red;">**`false`**</mark>`(기본값)`로 설정하면 본인인증 페이지로 리디렉션되고 본인인증을 완료하면 `param.m_redirect_url`로 다시 리디렉션됩니다.
>
> `param.popup`을 <mark style="color:red;">**`true`**</mark>로 설정하면 팝업(기본) 방식으로 작동합니다.
>
> **WebView 등 팝업이 차단되는 환경**에서는 `popup : false`로 설정하는 것을 권장합니다.

{% hint style="warning" %}
**리디렉션 방식**

포트원 JavaScript **SDK 1.1.7** 버전 이상 부터 지원합니다.
{% endhint %}

아래는 휴대폰 본인인증창을 호출하는 예제입니다.

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

```javascript
// IMP.certification(param, callback) 호출
  IMP.certification({ // param
    // 주문 번호
    pg:'PG사코드.{CPID}',//본인인증 설정이 2개이상 되어 있는 경우 필
    merchant_uid: "ORD20180131-0000011", 
    // 모바일환경에서 popup:false(기본값) 인 경우 필수
    m_redirect_url : "{리디렉션 될 URL}", 
    // PC환경에서는 popup 파라미터가 무시되고 항상 true 로 적용됨
    popup : false 
  }, function (rsp) { // callback
    if (rsp.success) {
      ...,
      // 인증 성공 시 로직,
      ...
    } else {
      ...,
      // 인증 실패 시 로직,
      ...
    }
  });
```

{% endcode %}

휴대폰 본인인증창을 호출하기 위한 [<mark style="color:blue;">**파라미터 목록**</mark>](/docs/sdk/javascript-sdk/cft.md)을 확인하세요
{% endtab %}

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

```javascript
 // IMP.certification(param, callback) 호출
  IMP.certification({ // param
    // 주문 번호
    pg:'PG사코드.{CPID}',//본인인증 설정이 2개이상 되어 있는 경우 필
    merchant_uid: "ORD20180131-0000011", 
    // 모바일환경에서 popup:false(기본값) 인 경우 필수
    m_redirect_url : "{리디렉션 될 URL}", 
    // PC환경에서는 popup 파라미터가 무시되고 항상 true 로 적용됨
    popup : false 
  }, rsp => { // callback
    if (rsp.success) {
      ...,
      // 인증 성공 시 로직,
      ...
    } else {
      ...,
      // 인증 실패 시 로직,
      ...
    }
  });
```

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


---

# 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/2..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.
