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

# OpenID FAPI認定テストに合格するようにAuth0を構成する

> OpenID FAPI認定テストに合格するようにAuth0を構成する方法を説明します。

このセクションには、[OpenID FAPI適合性テスト](https://openid.net/certification/certification-fapi_op_testing/)を使用してソリューションをテストする場合にクライアントを構成する方法に関するアドバイスが含まれています。

<Tooltip data-tooltip-id="react-containers-DefinitionTooltip-0" href="/docs/ja-jp/glossary?term=openid" tip="OpenID: アプリケーションがログイン情報を収集および保存することなくにユーザーのIDを検証できるようにする認証用のオープン標準。" cta="用語集の表示">OpenID</Tooltip> FAPI適合性テストに合格するには、まず次の設定を行います。

* `compliance_level`プロパティを、`fapi1_adv_pkj_par`または`fapi1_adv_mtls_par`のいずれかの目的のプロファイルに設定します
* [mTLS（](/docs/ja-jp/get-started/applications/configure-mtls)[mTLS](/docs/ja-jp/get-started/applications/configure-mtls/configure-mtls-for-a-tenant#enable-mtls-aliases)[エイリアスを含む）を構成](/docs/ja-jp/get-started/applications/configure-mtls)するか、[秘密鍵JWTを構成](/docs/ja-jp/get-started/applications/configure-private-key-jwt)
* [mTLSトークンバインディングを構成します](/docs/ja-jp/get-started/applications/configure-mtls/configure-mtls-for-a-client#enable-token-binding)

次に、以下の手順に従ってOpenID FAPI適合テストの構成を完了します。

* [Auth0がユーザーに同意を求めるプロンプトを表示するようにします](#ensure-auth0-prompts-users-for-consent)
* [テナントに対してサポートされているACRクレームを構成します](#configure-supported-acr-claims-for-the-tenant-)
* [JWKSエンドポイントからalgプロパティを削除します](#remove-the-alg-property-from-jwks-endpoint)
* [スコープとredirect\_uriを要求するアクションを追加します](#add-action-to-require-scope-and-redirect_uri)

### Auth0がユーザーに同意を求めることを確認する

Auth0がユーザーに同意を求めることを確認する必要があります。クライアントがファーストパーティアプリとして構成されており、リソースサーバーまたはAPIがファーストパーティアプリの同意のスキップをサポートしている場合は、この手順をスキップできます。Auth0がユーザーに同意を求めるようにするには、クライアントの`is_first_party`プロパティを`false`に設定します。

```bash lines theme={null}
curl --location --request PATCH 'https://$tenant/api/v2/clients/$client_id' \
  --header 'Authorization: Bearer $management_access_token' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "is_first_party": false  
}'
```

次に、以下のように接続をドメインレベルに昇格します。

```bash lines theme={null}
curl --location --request PATCH 'https://$tenant/api/v2/connections/$connection_id' \
  --header 'Authorization: Bearer $management_access_token' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "is_domain_connection": true
}'
```

#### テナントに対してサポートされているACRクレームを構成します

FAPIテストは、`urn:mace:incommon:iap:silver`の必須ACR値を渡します。IDトークンに必要なACR値を含めるには、以下のようにテナントでサポートされているACR値のリストに`urn:mace:incommon:iap:silver`を追加します。

```bash lines theme={null}
curl --location --request PATCH 'https://$tenant/api/v2/tenants/settings' \
  --header 'Authorization: Bearer $management_access_token' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "acr_values_supported": ["urn:mace:incommon:iap:silver"]
}'
```

#### JWKSエンドポイントからalgプロパティを削除します

キーをRS256だけでなく複数のアルゴリズムで使用できるようにするには、`/.well-known/jwks.json`エンドポイントの出力からテナントの`alg`プロパティを削除します。

```bash lines theme={null}
curl --location --request PATCH 'https://$tenant/api/v2/tenants/settings' \
  --header 'Authorization: Bearer $management_access_token' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "flags": {
        "remove_alg_from_jwks": true
    }
}'
```

#### スコープとredirect\_uriを要求するアクションを追加します

デフォルトでは、Auth0はスコープのない要求を許可します。スコープが存在しない場合は、`openid`スコープであると想定します。Auth0は、[アクション](/docs/ja-jp/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/redirect-with-actions)で設定できる`redirect_uri`のない要求も許可します。ただし、FAPI適合テストでは、Auth0の制限を強化する必要があります。

次のアクションを追加して、スコープと`redirect_uri` に必要な制限を適用します。

```javascript lines theme={null}
exports.onExecutePostLogin = async (event, api) => {
  if (!event.request.body || !event.request.body.refresh_token) {
    // Require a scope
    if (!event.request.query.scope) {
      api.access.deny('scope must be provided in the request');
    }
    // To improve the error message if redirect_uri is not present
    if (!event.request.query.redirect_uri) {
      api.access.deny('redirect_uri must be provided in the request');
    }
  }
};
```

## もっと詳しく

* [秘密鍵JWT認証の設定](/docs/ja-jp/get-started/applications/configure-private-key-jwt)
* [mTLS認証の設定](/docs/ja-jp/get-started/applications/configure-mtls)
