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

# WS-Fedアプリケーションを構成する

> Auth0をIDプロバイダーとして使用するように、WS-Fedアプリケーションを構成する方法について説明します。

Auth0をIDプロバイダーとして使用するように、<Tooltip data-tooltip-id="react-containers-DefinitionTooltip-2" href="/docs/ja-jp/glossary?term=ws-fed" tip="Webサービスフェデレーション（WS-Fed）: ドメイン全体でユーザーIDを管理するためのプロトコル。" cta="用語集の表示">WS-Fed</Tooltip>アプリケーション（サービスプロバイダー）を構成することができます。Auth0には、いくつかの汎用されるWS-Fedアプリケーションがあらかじめ構成されており、[シングルサインオン統合](/docs/ja-jp/customize/integrations/sso-integrations)に利用することができます。シングルサインオン統合のリストにWS-Fedアプリケーションが含まれていない場合には、以下の方法でWS-Fedアプリケーションの構成にアクセスできます。

1. **［Dashboard］>［Applications（アプリケーション）］>［Applications（アプリケーション）］** に移動します。

2. **［Create App（アプリの作成）］** をクリックします。

3. 名前を入力して、**［Save（保存）］** をクリックします。

4. **［Addons（アドオン）］** タブに移動します。

   <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
     1つのクライアントに対してSAMLアドオンとWD-Fedアドオンの両方を有効化することは、サポートされていません。動作が一貫しない可能性があります。アドオンごとに個別のクライアントを使用してください。
   </Callout>

5. **［WS-Fed Web App（WS-Fed Webアプリ）］** までスクロールして、**［Application Callback URL（アプリケーションのCallback URL）］** を入力します。これは、WS-FedアプリケーションのコールバックURLで、ここにWS-Fed応答がPOSTされます。アプリケーションによっては、このURLを**ACS** または**Assertion Consumer Service URL** と呼ぶこともあります。

6. **［Realm（領域）］** を入力します。これは、WS-Fedアプリケーションが送信する識別子で、応答内でアプリケーションを識別するのに使用されます。

## WS-Fedトークン応答に含まれるクレームを構成する

<Tooltip data-tooltip-id="react-containers-DefinitionTooltip-1" href="/docs/ja-jp/glossary?term=security-assertion-markup-language" tip="Security Assertion Markup Language（SAML）: パスワードなしに二者間で認証情報を交換できる標準化プロトコル。" cta="用語集の表示">SAML</Tooltip> Webアプリのアドオンとは異なり、WS-Fed Webアプリのアドオンには、Auth0が生成するトークンを構成するための構成設定がありません。デフォルトの設定を変更しなければならない場合には、以下のようなルールを作成することができます。

```javascript lines theme={null}
function (user, context, callback) {

  // only apply changes for the WS-Fed application
  if (context.clientName !== 'Your ws-fed application name') {
    return callback(null, user, context);
  }

  // exclude the upn claim creation (defaults to true)
  context.samlConfiguration.createUpnClaim = false;

  // exclude the identities array (defaults to true)
  context.samlConfiguration.mapIdentities = false;

  // exclude claims that were not explicitly mapped (defaults to true)
  context.samlConfiguration.passthroughClaimsWithNoMapping = false;

  // this is the default mapping. Remove or change as you like.
  // Note that the key (left side) is the attribute name (namespace-qualified)
  // and the value (right side) is the property name from the user object.
  // you can also use transient values from the user object. For example, for:
  //    user.calculated_field = <some expression>;
  // then add this mapping:
  //    'some_claim': 'calculated_field', 
  context.samlConfiguration.mappings = {
    'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier': 'user_id',
    'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress': 'email',
    'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name': 'name',
    'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname': 'given_name',
    'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname': 'family_name',
    'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn': 'upn',
    'http://schemas.xmlsoap.org/claims/Group': 'groups'
  };

  callback(null, user, context);
}
```

## カスタムドメイン

WS-Fedアプリにカスタムドメインを使用し、Auth0を<Tooltip data-tooltip-id="react-containers-DefinitionTooltip-2" href="/docs/ja-jp/glossary?term=idp" tip="IDプロバイダー（IdP）: デジタルIDを保存および管理するサービス。" cta="用語集の表示">IdP</Tooltip>として使う場合には、Auth0からのIDプロバイダーメタデータでサービスプロバイダーを更新します。メタデータは次から取得できます：

`https://<YOUR CUSTOM DOMAIN>/wsfed/FederationMetadata/2007-06/FederationMetadata.xml`

## 暗号化された応答

暗号化された応答が必要な場合には、SAML使ってADFSに接続する必要があります。詳細については、「[ADFSをSAML IDプロバイダーとして構成する](/docs/ja-jp/authenticate/protocols/saml/saml-sso-integrations/configure-auth0-saml-service-provider/configure-adfs-saml-connections)」と「[SAML要求を署名して暗号化する](/docs/ja-jp/authenticate/protocols/saml/saml-sso-integrations/sign-and-encrypt-saml-requests)」をお読みください。

## もっと詳しく

* [カスタムドメイン](/docs/ja-jp/customize/custom-domains)
* [Auth0統合](/docs/ja-jp/customize/integrations)
