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

# プロバイダーのアクセストークンを使ったソーシャル認証

> ソーシャルプロバイダーのアクセストークンを使ってユーザーを認証するための非推奨エンドポイントです。代わりにブラウザベースのソーシャルログインを使用してください。

## エンドポイント

`POST /oauth/access_token`

> [!NOTE]
>
> このエンドポイントは、レガシー認証パイプラインの一部です。代わりに、ソーシャル認証にはブラウザーを開く方法を推奨しています。これは、[Google と Facebook が推奨している方法](https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html)でもあります。最新の認証パイプラインについて詳しくは、[Introducing OIDC Conformant Authentication](/docs/api-auth/intro)を参照してください。
>
> 2017 年 6 月 8 日以降、新しいテナントではこの機能はデフォルトで無効になっています。詳しくは、[Application Grant Types](/docs/applications/concepts/application-grant-types)を参照してください。

ソーシャルプロバイダーのアクセストークンと`connection`を指定すると、このエンドポイントはそのプロバイダーでユーザーを認証し、アクセストークンと、必要に応じて ID トークンを含む JSON を返します。このエンドポイントは、Facebook、Google、Twitter、Weibo でのみ利用できます。

### 注記

* `profile` スコープ値は、End-User の既定のプロフィール クレーム (`name`、`family_name`、`given_name`、`middle_name`、`nickname`、`preferred_username`、`profile`、`picture`、`website`、`gender`、`birthdate`、`zoneinfo`、`locale`、`updated_at`) へのアクセスを求めます。

* `email` スコープ値は、`email` および `email_verified` クレームへのアクセスを求めます。

### 詳しく見る

* [IDプロバイダー API を呼び出す](https://auth0.com/docs/authenticate/identity-providers/calling-an-external-idp-api)
* [IDプロバイダー のアクセストークン](https://auth0.com/docs/secure/tokens/access-tokens/identity-provider-access-tokens)
* [IDプロバイダー の API を呼び出すためのスコープ/権限を追加する](https://auth0.com/docs/authenticate/identity-providers/adding-scopes-for-an-external-idp)

## Body Parameters

**client\_id** `string` *required*

アプリケーションの`client_id`。

**access\_token** `string` *required*

ソーシャルプロバイダーのアクセストークン。

**connection** `string` *required*

アプリに設定されているIDプロバイダーの名前。

**scope** `string`

IDトークンを取得するには`openid`を、ユーザー情報を含めるには`openid profile email`を使用します。

## レスポンススキーマ

200

\{}

application/json

**id\_token** `string`

IDトークン。

**access\_token** `string`

アクセストークン。

**token\_type** `string`

トークンのタイプ。通常は `Bearer`。

400 / 401 / 403

\{}

application/json

**error** `string`

エラーコード。

**error\_description** `string`

エラーの説明。

## レスポンスメッセージ

| Status | Description |
| - | - |
| 200 | 認証に成功した場合のレスポンス |
| 400 | 不正なリクエスト |
| 401 | 未認証 |
| 403 | アクセス禁止 |
| default | 予期しないエラー |
