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

# PIN 기반 인증

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>;
};

<div id="pin-based-authorization">
  ### PIN 기반 인증
</div>

PIN 기반 OAuth 플로우는 [3-legged OAuth](/ko/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>

 

<div id="implementing-the-pin-based-oauth-flow">
  #### PIN 기반 OAuth 플로 구현
</div>

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

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

2. 사용자가 [GET oauth/authenticate](/ko/resources/fundamentals/authentication/api-reference#get-oauth-authenticate) 또는 [GET oauth/authorize URL](/ko/resources/fundamentals/authentication/api-reference#get-oauth-authorize)를 통해 앱을 승인하기 위해 X로 이동한 후에는, 사용자가 `callback_url`로 리디렉션되지 않고, X에서 생성한 약 7자리 PIN과 함께 해당 PIN을 귀하의 애플리케이션에 입력하라는 안내가 표시된 화면을 보게 됩니다.

3. 사용자는 이 PIN을 애플리케이션에 입력하고, 애플리케이션은 이 PIN 번호를 `oauth_verifier`로 사용하여 [POST oauth/access\_token](/ko/resources/fundamentals/authentication/api-reference#post-oauth-access-token)을 호출해 `access_token`을 획득합니다.

<Note>
  **Note:** PIN 번호는 재사용할 수 없으며, 획득한 `access_token`은 애플리케이션 사용자에 대한 요청에 사용해야 합니다.
</Note>
