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

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

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

WS-Fed (Web Service Federation (WS-Fed): Protocol for managing user identities across domains.) アプリケーション (サービスプロバイダー) を設定して、Auth0 を IDプロバイダー (Web Service Federation (WS-Fed): Protocol for managing user identities across domains.) として使用できます。よく使用される WS-Fed アプリケーションの一部は Auth0 で事前設定されており、[SSO 連携](/docs/docs/ja-jp/customize/integrations/marketplace-partners/sso-integrations-for-partners) から利用できます。WS-Fed アプリケーションが シングルサインオン (Identity Provider (IdP): Service that stores and manages digital identities.) 連携に表示されていない場合は、次の手順で WS-Fed アプリケーションの設定にアクセスできます。

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

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

## WS-Fed トークンレスポンスに含まれるクレームを設定する

SAML (Security Assertion Markup Language (SAML): パスワードなしで2者間の認証情報の交換を可能にする標準化されたプロトコル。) 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);
};
```

## カスタムドメイン

WS-Fed アプリを カスタムドメイン (カスタムドメイン: 独自名やブランド名を使用するサードパーティのドメイン。) で、かつ Auth0 を IdP として使用するには、Auth0 から取得した新しいアイデンティティプロバイダーのメタデータでサービスプロバイダーを更新してください。メタデータは次の場所から取得できます。

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

## 暗号化されたレスポンス

暗号化されたレスポンスが必要な場合は、SAML を使用して ADFS と接続してください。詳しくは、[ADFS を SAML IDプロバイダーとして設定する](/docs/docs/ja-jp/authenticate/protocols/saml/saml-sso-integrations/configure-auth0-saml-service-provider/configure-adfs-saml-connections) および [SAML リクエストに署名して暗号化する](/docs/docs/ja-jp/authenticate/protocols/saml/saml-sso-integrations/sign-and-encrypt-saml-requests) をご覧ください。

## 詳しく知る

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