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

# デフォルトのログインルートを設定する

> テナントやアプリケーションにデフォルトのログインルートを構成する方法について説明します。

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()) {
              processedNode = processedNode.replace(new RegExp(key, "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 [processedChildren, setProcessedChildren] = useState(children);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      unsubscribe = window.autorun(() => {
        let processedChildren = children;
        for (const [key, value] of window.rootStore.variableStore.values.entries()) {
          processedChildren = processedChildren.replace(new RegExp(key, "g"), value);
        }
        setProcessedChildren(processedChildren);
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  return <CodeBlock filename={filename} icon={icon} language={language} lines highlight={highlight}>
      {processedChildren}
    </CodeBlock>;
};

場合によっては（以下を参照）、Auth0がOIDCサードパーティ起点のログインを使って、アプリケーションのログイン開始エンドポイントにリダイレクトしなければならないことがあります。詳細については、[OpenID Foundation](https://openid.net/specs/openid-connect-core-1_0.html#ThirdPartyInitiatedLogin)の「[Initiating Login from a Third Party](https://openid.net)」をお読みください。

これらのURIは、Dashboardの[［Application Settings（アプリケーション設定）］](https://manage.auth0.com/#/applications/settings)や[［Tenant Advanced Settings（高度なテナント設定）］](https://manage.auth0.com/#/tenant/advanced)、または<Tooltip data-tooltip-id="react-containers-DefinitionTooltip-0" href="/docs/ja-JP/ja-jp/glossary?term=management-api" tip="Management API: 顧客が管理タスクを実行できるようにするための製品。" cta="用語集の表示">Management API</Tooltip>で構成することができます。

<Tabs>
  <Tab title="アプリケーションレベル">
    <AuthCodeGroup>
      ```bash cURL theme={null}
      curl --request PATCH \
        --url 'https://{yourDomain}/api/v2/clients/{yourClientId}' \
        --header 'authorization: Bearer API2_ACCESS_TOKEN' \
        --header 'cache-control: no-cache' \
        --header 'content-type: application/json' \
        --data '{"initiate_login_uri": "<login_url>"}'
      ```

      ```csharp C# theme={null}
      var client = new RestClient("https://{yourDomain}/api/v2/clients/{yourClientId}");
      var request = new RestRequest(Method.PATCH);
      request.AddHeader("content-type", "application/json");
      request.AddHeader("authorization", "Bearer API2_ACCESS_TOKEN");
      request.AddHeader("cache-control", "no-cache");
      request.AddParameter("application/json", "{"initiate_login_uri": "<login_url>"}", ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      ```

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

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

      func main() {

      	url := "https://{yourDomain}/api/v2/clients/{yourClientId}"

      	payload := strings.NewReader("{"initiate_login_uri": "<login_url>"}")

      	req, _ := http.NewRequest("PATCH", url, payload)

      	req.Header.Add("content-type", "application/json")
      	req.Header.Add("authorization", "Bearer API2_ACCESS_TOKEN")
      	req.Header.Add("cache-control", "no-cache")

      	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.patch("https://{yourDomain}/api/v2/clients/{yourClientId}")
        .header("content-type", "application/json")
        .header("authorization", "Bearer API2_ACCESS_TOKEN")
        .header("cache-control", "no-cache")
        .body("{"initiate_login_uri": "<login_url>"}")
        .asString();
      ```

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

      var options = {
        method: 'PATCH',
        url: 'https://{yourDomain}/api/v2/clients/{yourClientId}',
        headers: {
          'content-type': 'application/json',
          authorization: 'Bearer API2_ACCESS_TOKEN',
          'cache-control': 'no-cache'
        },
        data: {initiate_login_uri: '<login_url>'}
      };

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

      ```objc Obj-C theme={null}
      #import <Foundation/Foundation.h>

      NSDictionary *headers = @{ @"content-type": @"application/json",
                                 @"authorization": @"Bearer API2_ACCESS_TOKEN",
                                 @"cache-control": @"no-cache" };
      NSDictionary *parameters = @{ @"initiate_login_uri": @"<login_url>" };

      NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

      NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://{yourDomain}/api/v2/clients/{yourClientId}"]
                                                             cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                         timeoutInterval:10.0];
      [request setHTTPMethod:@"PATCH"];
      [request setAllHTTPHeaderFields:headers];
      [request setHTTPBody:postData];

      NSURLSession *session = [NSURLSession sharedSession];
      NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                                  completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                      if (error) {
                                                          NSLog(@"%@", error);
                                                      } else {
                                                          NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                          NSLog(@"%@", httpResponse);
                                                      }
                                                  }];
      [dataTask resume];
      ```

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

      curl_setopt_array($curl, [
        CURLOPT_URL => "https://{yourDomain}/api/v2/clients/{yourClientId}",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "PATCH",
        CURLOPT_POSTFIELDS => "{"initiate_login_uri": "<login_url>"}",
        CURLOPT_HTTPHEADER => [
          "authorization: Bearer API2_ACCESS_TOKEN",
          "cache-control: no-cache",
          "content-type: application/json"
        ],
      ]);

      $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("")

      payload = "{"initiate_login_uri": "<login_url>"}"

      headers = {
          'content-type': "application/json",
          'authorization': "Bearer API2_ACCESS_TOKEN",
          'cache-control': "no-cache"
          }

      conn.request("PATCH", "/{yourDomain}/api/v2/clients/{yourClientId}", payload, 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/clients/{yourClientId}")

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

      request = Net::HTTP::Patch.new(url)
      request["content-type"] = 'application/json'
      request["authorization"] = 'Bearer API2_ACCESS_TOKEN'
      request["cache-control"] = 'no-cache'
      request.body = "{"initiate_login_uri": "<login_url>"}"

      response = http.request(request)
      puts response.read_body
      ```

      ```swift Swift theme={null}
      import Foundation

      let headers = [
        "content-type": "application/json",
        "authorization": "Bearer API2_ACCESS_TOKEN",
        "cache-control": "no-cache"
      ]
      let parameters = ["initiate_login_uri": "<login_url>"] as [String : Any]

      let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

      let request = NSMutableURLRequest(url: NSURL(string: "https://{yourDomain}/api/v2/clients/{yourClientId}")! as URL,
                                              cachePolicy: .useProtocolCachePolicy,
                                          timeoutInterval: 10.0)
      request.httpMethod = "PATCH"
      request.allHTTPHeaderFields = headers
      request.httpBody = postData as Data

      let session = URLSession.shared
      let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
        if (error != nil) {
          print(error)
        } else {
          let httpResponse = response as? HTTPURLResponse
          print(httpResponse)
        }
      })

      dataTask.resume()
      ```
    </AuthCodeGroup>
  </Tab>

  <Tab title="テナントレベル">
    <AuthCodeGroup>
      ```bash cURL theme={null}
      curl --request PATCH \
        --url 'https://{yourDomain}/api/v2/tenants/settings' \
        --header 'authorization: Bearer API2_ACCESS_TOKEN' \
        --header 'cache-control: no-cache' \
        --header 'content-type: application/json' \
        --data '{"default_redirection_uri": "<login_url>"}'
      ```

      ```csharp C# theme={null}
      var client = new RestClient("https://{yourDomain}/api/v2/tenants/settings");
      var request = new RestRequest(Method.PATCH);
      request.AddHeader("content-type", "application/json");
      request.AddHeader("authorization", "Bearer API2_ACCESS_TOKEN");
      request.AddHeader("cache-control", "no-cache");
      request.AddParameter("application/json", "{"default_redirection_uri": "<login_url>"}", ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      ```

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

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

      func main() {

      	url := "https://{yourDomain}/api/v2/tenants/settings"

      	payload := strings.NewReader("{"default_redirection_uri": "<login_url>"}")

      	req, _ := http.NewRequest("PATCH", url, payload)

      	req.Header.Add("content-type", "application/json")
      	req.Header.Add("authorization", "Bearer API2_ACCESS_TOKEN")
      	req.Header.Add("cache-control", "no-cache")

      	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.patch("https://{yourDomain}/api/v2/tenants/settings")
        .header("content-type", "application/json")
        .header("authorization", "Bearer API2_ACCESS_TOKEN")
        .header("cache-control", "no-cache")
        .body("{"default_redirection_uri": "<login_url>"}")
        .asString();
      ```

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

      var options = {
        method: 'PATCH',
        url: 'https://{yourDomain}/api/v2/tenants/settings',
        headers: {
          'content-type': 'application/json',
          authorization: 'Bearer API2_ACCESS_TOKEN',
          'cache-control': 'no-cache'
        },
        data: {default_redirection_uri: '<login_url>'}
      };

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

      ```objc Obj-C theme={null}
      #import <Foundation/Foundation.h>

      NSDictionary *headers = @{ @"content-type": @"application/json",
                                 @"authorization": @"Bearer API2_ACCESS_TOKEN",
                                 @"cache-control": @"no-cache" };
      NSDictionary *parameters = @{ @"default_redirection_uri": @"<login_url>" };

      NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

      NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://{yourDomain}/api/v2/tenants/settings"]
                                                             cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                         timeoutInterval:10.0];
      [request setHTTPMethod:@"PATCH"];
      [request setAllHTTPHeaderFields:headers];
      [request setHTTPBody:postData];

      NSURLSession *session = [NSURLSession sharedSession];
      NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                                  completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                      if (error) {
                                                          NSLog(@"%@", error);
                                                      } else {
                                                          NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                          NSLog(@"%@", httpResponse);
                                                      }
                                                  }];
      [dataTask resume];
      ```

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

      curl_setopt_array($curl, [
        CURLOPT_URL => "https://{yourDomain}/api/v2/tenants/settings",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "PATCH",
        CURLOPT_POSTFIELDS => "{"default_redirection_uri": "<login_url>"}",
        CURLOPT_HTTPHEADER => [
          "authorization: Bearer API2_ACCESS_TOKEN",
          "cache-control: no-cache",
          "content-type: application/json"
        ],
      ]);

      $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("")

      payload = "{"default_redirection_uri": "<login_url>"}"

      headers = {
          'content-type': "application/json",
          'authorization': "Bearer API2_ACCESS_TOKEN",
          'cache-control': "no-cache"
          }

      conn.request("PATCH", "/{yourDomain}/api/v2/tenants/settings", payload, 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/tenants/settings")

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

      request = Net::HTTP::Patch.new(url)
      request["content-type"] = 'application/json'
      request["authorization"] = 'Bearer API2_ACCESS_TOKEN'
      request["cache-control"] = 'no-cache'
      request.body = "{"default_redirection_uri": "<login_url>"}"

      response = http.request(request)
      puts response.read_body
      ```

      ```swift Swift theme={null}
      import Foundation

      let headers = [
        "content-type": "application/json",
        "authorization": "Bearer API2_ACCESS_TOKEN",
        "cache-control": "no-cache"
      ]
      let parameters = ["default_redirection_uri": "<login_url>"] as [String : Any]

      let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

      let request = NSMutableURLRequest(url: NSURL(string: "https://{yourDomain}/api/v2/tenants/settings")! as URL,
                                              cachePolicy: .useProtocolCachePolicy,
                                          timeoutInterval: 10.0)
      request.httpMethod = "PATCH"
      request.allHTTPHeaderFields = headers
      request.httpBody = postData as Data

      let session = URLSession.shared
      let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
        if (error != nil) {
          print(error)
        } else {
          let httpResponse = response as? HTTPURLResponse
          print(httpResponse)
        }
      })

      dataTask.resume()
      ```
    </AuthCodeGroup>
  </Tab>
</Tabs>

***

`login_url`は、Auth0の`/authorize`エンドポイントにリダイレクトされるアプリケーションのルートをポイントします（例：`https://mycompany.org/login`）。これには`https`が必須で、`localhost`はポイントできません。`login_url`には、クエリパラメーターとURIフラグメントを含めることができます。

OIDCサードパーティ起点のログイン仕様に基づいて、リダイレクトの前に、発行者識別子が含まれる`iss`パラメーターが、クエリ文字列パラメーターとして`login_url`に追加されます。

<div id="redirect-default-login-route-scenarios">
  ## デフォルトのログインルートにリダイレクトするシナリオ
</div>

<div id="users-bookmark-login-page">
  ### ユーザーがログインページをブックマーク
</div>

アプリケーションがログインプロセスが開始すると、[必要なパラメーター](/docs/ja-JP/ja-jp/api/authentication#login)セットを使って`https://{yourDomain}/authorize`に移動します。Auth0は、エンドユーザーを`https://{yourDomain}/login`ページにリダイレクトし、URLは次のようになります。

`https://{yourDomain}/login?state=g6Fo2SBjNTRyanlVa3ZqeHN4d1htTnh&...`

`state`パラメーターは内部データベースのレコードをポイントし、ここで認可トランザクションのステータスを追跡します。トランザクション完了時または一定時間の経過後、レコードは内部データベースから削除されます。

Organizationsを使用している場合、エンドユーザーが組織のログインプロンプトをブックマークに登録すると、Auth0がユーザーをデフォルトのログインルートにリダイレクトする際に`organization`パラメーターも含めます。

ユーザーがログインページをブックマークに登録して、その`/login` URLに移動すると、トランザクションレコードがなくなっているため、Auth0がログインフローを続行できないことがあります。この場合、Auth0はデフォルトのクライアントURL（構成されている場合）またはテナントレベルのURL（構成されていない場合）にリダイレクトします。デフォルトのログインURLが設定されていない場合は、エラーページが表示されます。

<div id="complete-password-reset-flow">
  ### パスワードリセットフローを完了する
</div>

パスワードリセットフローを完了し、アプリケーションまたはテナントのデフォルトのURIが構成されると、ユーザーにログインページに戻るためのボタンが表示されます。

この動作は、ユニバーサルログインエクスペリエンスが有効な場合にのみ起こります。クラシックログインでは、Change Password（パスワード変更）テンプレートでリダイレクトURLを構成する必要があります。詳細については、「[メールテンプレートをカスタマイズする](/docs/ja-JP/ja-jp/customize/email/email-templates)」をお読みください。

ユニバーサルログインを使うテナントの場合、[`/post-password-change`](/docs/ja-JP/ja-jp/api/management/v2/#!/Tickets/post_password_change)エンドポイントは、ユーザーを特定のアプリケーションにリダイレクトする動作に対応しています。`client_id`が指定され、アプリケーションのログインURIが設定されている場合は、パスワードのリセット完了後にユーザーをアプリケーションに送り返すボタンが表示されます。

<AuthCodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://{yourDomain}/api/v2/tickets/password-change' \
    --header 'authorization: Bearer MGMT_API_ACCESS_TOKEN' \
    --header 'content-type: application/json' \
    --data '{ "user_id": "A_USER_ID", "client_id": "A_CLIENT_ID" }'
  ```

  ```csharp C# theme={null}
  var client = new RestClient("https://{yourDomain}/api/v2/tickets/password-change");
  var request = new RestRequest(Method.POST);
  request.AddHeader("content-type", "application/json");
  request.AddHeader("authorization", "Bearer MGMT_API_ACCESS_TOKEN");
  request.AddParameter("application/json", "{ "user_id": "A_USER_ID", "client_id": "A_CLIENT_ID" }", ParameterType.RequestBody);
  IRestResponse response = client.Execute(request);
  ```

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

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

  func main() {

  	url := "https://{yourDomain}/api/v2/tickets/password-change"

  	payload := strings.NewReader("{ "user_id": "A_USER_ID", "client_id": "A_CLIENT_ID" }")

  	req, _ := http.NewRequest("POST", url, payload)

  	req.Header.Add("content-type", "application/json")
  	req.Header.Add("authorization", "Bearer MGMT_API_ACCESS_TOKEN")

  	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.post("https://{yourDomain}/api/v2/tickets/password-change")
    .header("content-type", "application/json")
    .header("authorization", "Bearer MGMT_API_ACCESS_TOKEN")
    .body("{ "user_id": "A_USER_ID", "client_id": "A_CLIENT_ID" }")
    .asString();
  ```

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

  var options = {
    method: 'POST',
    url: 'https://{yourDomain}/api/v2/tickets/password-change',
    headers: {
      'content-type': 'application/json',
      authorization: 'Bearer MGMT_API_ACCESS_TOKEN'
    },
    data: {user_id: 'A_USER_ID', client_id: 'A_CLIENT_ID'}
  };

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

  ```objc Obj-C theme={null}
  #import <Foundation/Foundation.h>

  NSDictionary *headers = @{ @"content-type": @"application/json",
                             @"authorization": @"Bearer MGMT_API_ACCESS_TOKEN" };
  NSDictionary *parameters = @{ @"user_id": @"A_USER_ID",
                                @"client_id": @"A_CLIENT_ID" };

  NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://{yourDomain}/api/v2/tickets/password-change"]
                                                         cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                     timeoutInterval:10.0];
  [request setHTTPMethod:@"POST"];
  [request setAllHTTPHeaderFields:headers];
  [request setHTTPBody:postData];

  NSURLSession *session = [NSURLSession sharedSession];
  NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                              completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                  if (error) {
                                                      NSLog(@"%@", error);
                                                  } else {
                                                      NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                      NSLog(@"%@", httpResponse);
                                                  }
                                              }];
  [dataTask resume];
  ```

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

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{yourDomain}/api/v2/tickets/password-change",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{ "user_id": "A_USER_ID", "client_id": "A_CLIENT_ID" }",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer MGMT_API_ACCESS_TOKEN",
      "content-type: application/json"
    ],
  ]);

  $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("")

  payload = "{ "user_id": "A_USER_ID", "client_id": "A_CLIENT_ID" }"

  headers = {
      'content-type': "application/json",
      'authorization': "Bearer MGMT_API_ACCESS_TOKEN"
      }

  conn.request("POST", "/{yourDomain}/api/v2/tickets/password-change", payload, 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/tickets/password-change")

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

  request = Net::HTTP::Post.new(url)
  request["content-type"] = 'application/json'
  request["authorization"] = 'Bearer MGMT_API_ACCESS_TOKEN'
  request.body = "{ "user_id": "A_USER_ID", "client_id": "A_CLIENT_ID" }"

  response = http.request(request)
  puts response.read_body
  ```

  ```swift Swift theme={null}
  import Foundation

  let headers = [
    "content-type": "application/json",
    "authorization": "Bearer MGMT_API_ACCESS_TOKEN"
  ]
  let parameters = [
    "user_id": "A_USER_ID",
    "client_id": "A_CLIENT_ID"
  ] as [String : Any]

  let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

  let request = NSMutableURLRequest(url: NSURL(string: "https://{yourDomain}/api/v2/tickets/password-change")! as URL,
                                          cachePolicy: .useProtocolCachePolicy,
                                      timeoutInterval: 10.0)
  request.httpMethod = "POST"
  request.allHTTPHeaderFields = headers
  request.httpBody = postData as Data

  let session = URLSession.shared
  let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
    if (error != nil) {
      print(error)
    } else {
      let httpResponse = response as? HTTPURLResponse
      print(httpResponse)
    }
  })

  dataTask.resume()
  ```
</AuthCodeGroup>

<div id="complete-email-verification-flow">
  ### メール検証フローを完了する
</div>

サインアッププロセスの一環として、識別子にメールを選択したユーザーは、メールアドレスの確認メールを受信します。リンクをクリックすると、メールが確認されたことを示すページに移動し、アプリケーションに戻るためのボタンが提供されます。クリックすると、ログインページにリダイレクトされます。有効なセッションがすでに存在する場合は、アプリケーションにリダイレクトされることになります。

この動作は、ユニバーサルログインエクスペリエンスが有効な場合にのみ起こります。クラシックログインでは、Verification Email（確認メール）テンプレートでリダイレクトURLを構成する必要があります。

<div id="invite-organization-members">
  ### 組織メンバーを招待する
</div>

ユーザーが[組織](/docs/ja-JP/ja-jp/manage-users/organizations/organizations-overview)への参加に招待されると、メールで招待リンクを受け取ります。リンクを選択すると、招待に特定のパラメーターが追加された構成済みのデフォルトログインルートにリダイレクトされます。

たとえば、組織対応のアプリケーションで **［Application Login URI（アプリケーションログインURI）］** が`https://myapp.com/login`に設定されている場合、エンドユーザーが受け取る招待メールには、以下のリンクが含まれます。`https://myapp.com/login?invitation={invitation_ticket_id}&organization={organization_id}&organization_name={organization_name}`

そのため、アプリケーションのルートは、クエリ文字列で`invitation`パラメーターと`organization`パラメーターを受け入れる必要があります。招待受諾トランザクションを開始するには、エンドユーザーとともに両方のパラメーターをAuth0の`/authorize`エンドポイントに転送します。

<div id="disabled-cookies">
  ### 無効になったクッキー
</div>

ブラウザーでクッキーが無効になった状態で、ユーザーが`https://{yourDomain}/authorize`に移動すると、Auth0はユーザーをアプリケーションのログインURIにリダイレクトします。アプリケーションのログインURIが設定されていない場合、リダイレクトはテナントのログインURIに送信されます。

ユーザーをログインページに送り返すと、リダイレクトのループが発生する恐れがあります。この問題を回避するには、ランディングページを使ってクッキーの可用性を確認します。無効な場合は、続行にクッキーの有効化が必要なことをユーザーに警告します。

<div id="learn-more">
  ## もっと詳しく
</div>

* [メールテンプレートをカスタマイズする](/docs/ja-JP/ja-jp/customize/email/email-templates)
* [APIの呼び出しをチェックする](/docs/ja-JP/ja-jp/troubleshoot/authentication-issues/check-api-calls)
* [エラーメッセージを確認する](/docs/ja-JP/ja-jp/troubleshoot/basic-issues/check-error-messages)
* [認証APIを使って認証要素を管理する](/docs/ja-JP/ja-jp/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authenticator-factors-mfa-api)
