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

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

# WS-Fed アプリケーションを設定する

<Tooltip tip="Web Service Federation (WS-Fed): Protocol for managing user identities across domains." cta="View Glossary" href="/docs/ja-jp/glossary?term=WS-Fed">WS-Fed</Tooltip> アプリケーション (サービスプロバイダー) を設定して、Auth0 を <Tooltip tip="Web Service Federation (WS-Fed): Protocol for managing user identities across domains." cta="View Glossary" href="/docs/ja-jp/glossary?term=identity+provider">アイデンティティプロバイダー</Tooltip> として使用できます。よく使用される WS-Fed アプリケーションの一部は Auth0 で事前設定されており、[SSO 連携](/docs/ja-jp/customize/integrations/sso-integrations) から利用できます。WS-Fed アプリケーションが <Tooltip tip="Identity Provider (IdP): Service that stores and manages digital identities." cta="View Glossary" href="/docs/ja-jp/glossary?term=Single+Sign-On">シングルサインオン</Tooltip> 連携に表示されていない場合は、次の手順で WS-Fed アプリケーションの設定にアクセスできます。

1. **Auth0 Dashboard >** **アプリケーション > アプリケーション** に移動します。
2. **Create App** をクリックします。
3. 名前を入力し、**Save** をクリックします。
4. **アドオン** タブに移動します。

   <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
     1 つのクライアントで SAML と WS-Fed の両方のアドオンを有効にすることはサポート対象外であり、動作が不安定になる可能性があります。アドオンごとに別々のクライアントを使用してください。
   </Callout>
5. **WS-Fed Web App** までスクロールし、**Application Callback URL** を入力します。これは、WS-Fed 応答の POST 先となる、WS-Fed アプリケーション側のコールバック URL です。アプリケーションによっては、**ACS** または **Assertion Consumer Service URL** と呼ばれることもあります。
6. **レルム** を入力します。これは WS-Fed アプリケーションから送信される識別子で、レスポンス内でアプリケーションを識別するために使用されます。

<div id="configure-claims-included-in-the-ws-fed-token-response">
  ## WS-Fed トークンレスポンスに含まれるクレームを設定する
</div>

<Tooltip tip="Security Assertion Markup Language (SAML): パスワードなしで2者間の認証情報の交換を可能にする標準化されたプロトコル。" cta="用語集を見る" href="/docs/ja-jp/glossary?term=SAML">SAML</Tooltip> Web App addon とは異なり、WS-Fed Web App addon には、Auth0 が生成するトークンを設定するための構成項目はありません。デフォルト設定を変更する必要がある場合は、以下のような post-login Action を作成できます。

```javascript lines expandable theme={null}
exports.onExecutePostLogin = async (event, api) => {

  // WS-Fedアプリケーションにのみ変更を適用する
  if (event.client.name !== 'Your ws-fed application name') {
    return;
  }

  // upnクレームの作成を除外する（デフォルトはtrue）
  api.samlResponse.setCreateUpnClaim(false);

  // identities配列を除外する（デフォルトはtrue）
  api.samlResponse.setMapIdentities(false);

  // 明示的にマッピングされていないクレームを除外する（デフォルトはtrue）
  api.samlResponse.setPassthroughClaimsWithNoMapping(false);

  // これはデフォルトのマッピングです。必要に応じて削除または変更してください。
  api.samlResponse.setAttribute('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier', event.user.user_id);
  api.samlResponse.setAttribute('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress', event.user.email || null);
  api.samlResponse.setAttribute('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name', event.user.name || null);
  api.samlResponse.setAttribute('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname', event.user.given_name || null);
  api.samlResponse.setAttribute('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname', event.user.family_name || null);
};
```

<div id="custom-domains">
  ## カスタムドメイン
</div>

WS-Fed アプリを <Tooltip tip="カスタムドメイン: 独自名やブランド名を使用するサードパーティのドメイン。" cta="用語集を見る" href="/docs/ja-jp/glossary?term=custom+domain">カスタムドメイン</Tooltip> で、かつ Auth0 を IdP として使用するには、Auth0 から取得した新しいアイデンティティプロバイダーのメタデータでサービスプロバイダーを更新してください。メタデータは次の場所から取得できます。

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

<div id="encrypted-responses">
  ## 暗号化されたレスポンス
</div>

暗号化されたレスポンスが必要な場合は、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) をご覧ください。

<div id="learn-more">
  ## 詳しく知る
</div>

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