> ## 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.

> SAML IDプロバイダーの設定項目について説明します。

# SAML IDプロバイダーの設定項目

export const AuthCodeGroup = ({children, dropdown}) => {
  const [processedChildren, setProcessedChildren] = useState(children);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      unsubscribe = window.autorun(() => {
        const processChildren = node => {
          if (typeof node === "string") {
            let processedNode = node;
            for (const [key, value] of window.rootStore.variableStore.values.entries()) {
              const escapedKey = key.replaceAll(/[.*+?^${}()|[\]\\]/g, (String.raw)`\$&`);
              processedNode = processedNode.replaceAll(new RegExp(escapedKey, "g"), value);
            }
            return processedNode;
          } else if (Array.isArray(node)) {
            return node.map(processChildren);
          } else if (node && node.props && node.props.children) {
            return {
              ...node,
              props: {
                ...node.props,
                children: processChildren(node.props.children)
              }
            };
          }
          return node;
        };
        setProcessedChildren(processChildren(children));
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  return <CodeGroup dropdown={dropdown}>{processedChildren}</CodeGroup>;
};

export const AuthCodeBlock = ({filename, icon, language, highlight, children}) => {
  const [displayText, setDisplayText] = useState(children);
  const [copyText, setCopyText] = useState(children);
  const wrapperRef = React.useRef(null);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      if (!window.autorun || !window.rootStore) {
        return;
      }
      unsubscribe = window.autorun(() => {
        let processedChildrenForDisplay = children;
        let processedChildrenForCopy = children;
        for (const [key, value] of window.rootStore.variableStore.values.entries()) {
          const escapedKey = key.replaceAll(/[.*+?^${}()|[\]\\]/g, (String.raw)`\$&`);
          let displayValue = value;
          if (key === "{yourClientSecret}" && value !== "{yourClientSecret}") {
            displayValue = value.substring(0, 3) + "*****マスク済み*****";
          }
          processedChildrenForDisplay = processedChildrenForDisplay.replaceAll(new RegExp(escapedKey, "g"), displayValue);
          processedChildrenForCopy = processedChildrenForCopy.replaceAll(new RegExp(escapedKey, "g"), value);
        }
        setDisplayText(processedChildrenForDisplay);
        setCopyText(processedChildrenForCopy);
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  useEffect(() => {
    if (!wrapperRef.current) return;
    const originalWriteText = navigator.clipboard.writeText.bind(navigator.clipboard);
    let isOverriding = false;
    const handleClick = e => {
      const button = e.target.closest('[data-testid="copy-code-button"]');
      if (!button || !wrapperRef.current.contains(button)) return;
      isOverriding = true;
      navigator.clipboard.writeText = text => {
        if (isOverriding) {
          isOverriding = false;
          navigator.clipboard.writeText = originalWriteText;
          return originalWriteText(copyText);
        }
        return originalWriteText(text);
      };
      setTimeout(() => {
        if (isOverriding) {
          isOverriding = false;
          navigator.clipboard.writeText = originalWriteText;
        }
      }, 100);
    };
    const wrapper = wrapperRef.current;
    wrapper.addEventListener('click', handleClick, true);
    return () => {
      wrapper.removeEventListener('click', handleClick, true);
      if (navigator.clipboard.writeText !== originalWriteText) {
        navigator.clipboard.writeText = originalWriteText;
      }
    };
  }, [copyText]);
  return <div ref={wrapperRef}>
      <CodeBlock filename={filename} icon={icon} language={language} lines highlight={highlight}>
        {displayText}
      </CodeBlock>
    </div>;
};

<div id="common-settings">
  ## 共通設定
</div>

以下は、<Tooltip tip="Security Assertion Markup Language（SAML）: パスワードなしで 2 者間の認証情報のやり取りを可能にする標準化されたプロトコルです。" cta="用語集を表示" href="/ja/docs/glossary?term=SAML">SAML</Tooltip> <Tooltip tip="Security Assertion Markup Language（SAML）: パスワードなしで 2 者間の認証情報のやり取りを可能にする標準化されたプロトコルです。" cta="用語集を表示" href="/ja/docs/glossary?term=identity+provider">IDプロバイダー</Tooltip> (IdP) を設定するための共通設定です。

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  [カスタムドメイン](/ja/docs/customize/custom-domains)を設定している場合は、Auth0ドメインの代わりにカスタムドメインのCNAMEを使用する必要があります。詳しくは、[機能でカスタムドメインを使用するように設定する](/ja/docs/customize/custom-domains/configure-features-to-use-custom-domains#configure-saml-identity-providers)を参照してください。
</Callout>

<div id="post-back-url">
  ### ポストバック URL
</div>

IdP 起点の <Tooltip tip="シングルサインオン（SSO）: ユーザーが1 つのアプリケーションにログインすると、他のアプリケーションにも自動的にサインインできるようにするサービスです。" cta="用語集を見る" href="/ja/docs/glossary?term=SSO">SSO</Tooltip> を使用する場合は、ポストバック URL に connection パラメーターを必ず含めてください。

export const codeExample1 = `https://{yourDomain}/login/callback?connection={yourConnectionName}`;

<AuthCodeBlock children={codeExample1} language="http" />

[組織](/ja/docs/manage-users/organizations) 機能を使用している場合は、必要に応じて、対象の組織の ID を含む `organization` パラメーターを指定できます。

export const codeExample2 = `https://{yourDomain}/login/callback?connection={yourConnectionName}&organization={yourCustomersOrganizationId}`;

<AuthCodeBlock children={codeExample2} language="http" />

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  ユーザーがこの方法で正常にログインするには、その接続をその組織で有効にする必要があります。さらに、有効にした接続に対して[自動メンバーシップ](/ja/docs/manage-users/organizations/configure-organizations/grant-just-in-time-membership)を設定するか、ユーザーがその組織のメンバーであることを確認する必要があります。
</Callout>

<div id="entity-id">
  ### Entity ID
</div>

サービスプロバイダーの ID は次のとおりです:

```http lines theme={null}
urn:auth0:{yourTenant}:{yourConnectionName}
```

`connection.options.entityId` プロパティを使用して、カスタム Entity ID を設定できます。詳しくは、[カスタム Entity ID を指定する](/ja/docs/authenticate/identity-providers/enterprise-identity-providers/saml#specify-a-custom-entity-id)を参照してください。

Get a Connection エンドポイントを使用すると、カスタム Entity ID の値を取得できます。

<AuthCodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://{yourDomain}/api/v2/connections/%7ByourConnectionID%7D' \
    --header 'authorization: Bearer {yourAccessToken}'
  ```

  ```csharp C# theme={null}
  var client = new RestClient("https://{yourDomain}/api/v2/connections/%7ByourConnectionID%7D");
  var request = new RestRequest(Method.GET);
  request.AddHeader("authorization", "Bearer {yourAccessToken}");
  IRestResponse response = client.Execute(request);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{yourDomain}/api/v2/connections/%7ByourConnectionID%7D"

  	req, _ := http.NewRequest("GET", url, nil)

  	req.Header.Add("authorization", "Bearer {yourAccessToken}")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```

  ```java Java theme={null}
  HttpResponse<String> response = Unirest.get("https://{yourDomain}/api/v2/connections/%7ByourConnectionID%7D")
    .header("authorization", "Bearer {yourAccessToken}")
    .asString();
  ```

  ```javascript Node.JS theme={null}
  var axios = require("axios").default;

  var options = {
    method: 'GET',
    url: 'https://{yourDomain}/api/v2/connections/%7ByourConnectionID%7D',
    headers: {authorization: 'Bearer {yourAccessToken}'}
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```php PHP theme={null}
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{yourDomain}/api/v2/connections/%7ByourConnectionID%7D",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer {yourAccessToken}"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python theme={null}
  import http.client

  conn = http.client.HTTPSConnection("")

  headers = { 'authorization': "Bearer {yourAccessToken}" }

  conn.request("GET", "/{yourDomain}/api/v2/connections/%7ByourConnectionID%7D", headers=headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{yourDomain}/api/v2/connections/%7ByourConnectionID%7D")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Get.new(url)
  request["authorization"] = 'Bearer {yourAccessToken}'

  response = http.request(request)
  puts response.read_body
  ```
</AuthCodeGroup>

`ACCESS_TOKEN` ヘッダーの値は、Management API v2 の <Tooltip tip="アクセストークン: API へのアクセスに使用される認可資格情報で、不透明な文字列または JWT の形式です。" cta="用語集を表示" href="/ja/docs/glossary?term=access+token">アクセストークン</Tooltip> に置き換えてください。

<div id="saml-request-binding">
  ### SAML リクエスト バインディング
</div>

**Protocol Binding** とも呼ばれ、Auth0 から IdP に送信されます。可能であれば、`connection.options.protocolBinding` に基づいて値を動的に設定します。

| `connection.options.protocolBinding` の値              | SAML Request Binding の値 |
| ---------------------------------------------------- | ----------------------- |
| 空の値 ("") または未指定                                      | `HTTP-Redirect`         |
| `urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect` | `HTTP-Redirect`         |
| `urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST`     | `HTTP-POST`             |

値を動的に設定できない場合は、`HTTP-Redirect` (デフォルト) に設定するか、**Protocol Binding** でこのオプションを選択している場合は `HTTP-Post` に設定してください。

<div id="saml-response-binding">
  ### SAML レスポンスバインディング
</div>

IdP から Auth0 が SAML トークンを受信する方式で、`HTTP-Post` に設定します。

<div id="nameid-format">
  ### NameID 形式
</div>

未指定。

<div id="saml-assertion-and-response">
  ### SAML アサーションとレスポンス
</div>

SAML アサーションと SAML レスポンスには、個別にも同時にも署名できます。

<div id="singlelogout-service-url">
  ### SingleLogout サービス URL
</div>

SAML IDプロバイダーがログアウトのリクエストとレスポンスを送信する先です。

export const codeExample13 = `https://{yourDomain}/logout`;

<AuthCodeBlock children={codeExample13} language="http" />

SAML のログアウトリクエストは、IDプロバイダーが署名する必要があります。

<div id="signed-assertions">
  ## 署名付きアサーション
</div>

公開鍵をさまざまな形式で取得するには、以下のリンクを使用してください。

* <AuthLink href="https://{yourDomain}/cer?cert=connection">CER</AuthLink>
* <AuthLink href="https://{yourDomain}/pem?cert=connection">PEM</AuthLink>
* <AuthLink href="https://{yourDomain}/rawpem?cert=connection">raw PEM</AuthLink>
* <AuthLink href="https://{yourDomain}/pb7?cert=connection">PKCS#7</AuthLink>
* <AuthLink href="https://{yourDomain}/fingerprint?cert=connection">フィンガープリント</AuthLink>

IdP で要求される形式の証明書をダウンロードしてください。

<div id="idp-initiated-single-sign-on">
  ### IdP 起点のシングルサインオン
</div>

IdP 起点の SSO については、[SAML IdP 起点のシングルサインオンを設定する](/ja/docs/authenticate/protocols/saml/saml-sso-integrations/identity-provider-initiated-single-sign-on)を参照してください。

<div id="metadata">
  ## メタデータ
</div>

一部の SAML IDプロバイダーでは、必要な情報がすべて含まれたメタデータを直接インポートできます。Auth0 では、接続のメタデータを次の場所で確認できます。

export const codeExample14 = `https://{yourDomain}/samlp/metadata?connection={yourConnectionName}`;

<AuthCodeBlock children={codeExample14} language="http" />

<div id="organizations">
  ## 組織
</div>

組織のログインフローを開始するには、フェデレーションIdPで組織のACS URLを使用します。

export const codeExample15 = `https://{yourDomain}/samlp?connection={yourConnectionName}&organization={yourOrgID}`;

<AuthCodeBlock children={codeExample15} language="http" />

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

* [接続 ID または名前を確認する](/ja/docs/authenticate/identity-providers/locate-the-connection-id)
* [SAML アサーションをカスタマイズする](/ja/docs/authenticate/protocols/saml/saml-configuration/customize-saml-assertions)
