> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PIN 기반 승인

> CLI 도구 및 게임 콘솔과 같이 브라우저를 임베드할 수 없는 X 앱을 위해 숫자 PIN을 oauth_verifier로 입력하여 PIN 기반 OAuth 흐름을 사용하세요.

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <span>
          {children}
        </span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

### PIN 기반 승인

PIN 기반 OAuth 흐름은 [3-legged OAuth](/resources/fundamentals/authentication/oauth-1-0a/obtaining-user-access-tokens) 프로세스의 버전이며 승인 후 사용자를 리다이렉트하기 위해 웹 브라우저에 액세스하거나 임베드할 수 없는 애플리케이션을 위한 것입니다. 이러한 애플리케이션의 예로는 명령줄 애플리케이션, 임베디드 시스템, 게임 콘솔 및 특정 유형의 모바일 앱이 있습니다.

PIN 기반 OAuth 흐름은 앱이 `oauth_callback`을 `oob`로 설정한 `request_token`에서 시작됩니다. `oob`라는 용어는 out-of-band OAuth를 의미합니다. 사용자는 여전히 X를 방문하여 로그인하거나 앱을 승인하지만, 액세스 승인 시 애플리케이션으로 자동으로 리다이렉트되지 않습니다. 대신, 애플리케이션으로 돌아가서 이 값을 입력하라는 지시와 함께 숫자 PIN 코드를 보게 됩니다.

<Note>
  **참고:** PIN 기반 인증을 사용하는 경우에도 X 앱 설정 내의 `callback_url`은 여전히 필수입니다.
</Note>

#### PIN 기반 OAuth 흐름 구현하기

PIN 기반 흐름은 [3-legged 승인](/resources/fundamentals/authentication/oauth-1-0a/obtaining-user-access-tokens) (및 [Sign in with X](/resources/fundamentals/authentication#log-in-with-x))과 동일한 방식으로 구현되지만 다음과 같은 차이점이 있습니다:

1. [POST oauth/request\_token](/resources/fundamentals/authentication/api-reference#post-oauth-request-token) 호출 중에 `oauth_callback` 값은 `oob`로 설정되어야 합니다.

2. 사용자가 [GET oauth/authenticate](/resources/fundamentals/authentication/api-reference#get-oauth-authenticate) 또는 [GET oauth/authorize URL](/resources/fundamentals/authentication/api-reference#get-oauth-authorize)을 사용하여 앱을 승인하기 위해 X로 전송된 후, `callback_url`로 리다이렉트되지 않고 대신 애플리케이션 이름에 PIN을 입력하라는 지시와 함께 X가 생성한 약 7자리 PIN이 표시되는 화면을 보게 됩니다.

3. 사용자가 이 PIN을 애플리케이션에 입력하면, 애플리케이션은 access\_token을 얻기 위해 PIN 번호를 [POST oauth/access\_token](/resources/fundamentals/authentication/api-reference#post-oauth-access-token)에서 `oauth_verifier`로 사용합니다.

<Note>
  **참고:** PIN 번호는 재사용할 수 없으며, 얻은 `access_token`은 application-user 요청에 사용되어야 합니다.
</Note>
