{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["img"]},"type":"markdown"},"seo":{"title":"認証"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"認証","__idx":0},"children":["認証"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["MoreLogin は、2 つの API タイプに対して異なる認証方法を使用します。"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ローカルapi認証","__idx":1},"children":["ローカルAPI認証"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ローカル API は ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http://127.0.0.1:40000"]}," で実行され、ローカル マシンからのみアクセスできます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"デフォルトモード認証なし","__idx":2},"children":["デフォルトモード（認証なし）"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["デフォルトでは、ローカル API は認証を必要としません。リクエストは直接行うことができます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST http://127.0.0.1:40000/api/env/page \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"pageNo\": 1,\n    \"pageSize\": 10\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"認証の有効化","__idx":3},"children":["認証の有効化"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["セキュリティを強化するために、MoreLogin クライアントでローカル API 認証を有効にすることができます。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["MoreLogin クライアントを開きます"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["設定"]}," → ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API と MCP"]}," に移動します"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ローカル API 認証"]}," を有効にする"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["生成された認証トークンをコピーします"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image.590455fe8c04c7aec45454ddba2524af46ee8128e15fbef43221c071f4863f91.39e4c13f.png","alt":"ローカル API 認証を有効にする"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["有効にした後、すべてのリクエストに ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," ヘッダーを含めます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST http://127.0.0.1:40000/api/env/page \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: YOUR_AUTH_TOKEN\" \\\n  -d '{\n    \"pageNo\": 1,\n    \"pageSize\": 10\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["セキュリティに関する注意"]},": ローカル API は ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["localhost"]}," でのみ使用できます。リモートからはアクセスできません。"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"オープンapi認証oauth2","__idx":4},"children":["オープンAPI認証(OAuth2)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open API は、OAuth2 クライアント認証情報フローを使用してリクエストを認証します。"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["API サーバー エンドポイントを開く: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.morelogin.com"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ステップ-1-api-id-と-api-キーを取得する","__idx":5},"children":["ステップ 1: API ID と API キーを取得する"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["MoreLogin クライアントを開きます"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["設定"]}," → ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API と MCP"]}," に移動します"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API ID"]}," と ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API キー"]}," をコピーします。"]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/image.5fd3488a120b7d8e2f400229cb0ad75e34ad8299fa6cfc9c304c29662ff9ade1.a53526f8.png","alt":"API ID とキー","framed":false,"withLightbox":true,"width":"","height":""},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ステップ-2-アクセス-トークンを取得する","__idx":6},"children":["ステップ 2: アクセス トークンを取得する"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["API ID と API キーをアクセス トークンと交換します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.morelogin.com/oauth2/token \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"client_id\": \"YOUR_API_ID\",\n    \"client_secret\": \"YOUR_API_KEY\",\n    \"grant_type\": \"client_credentials\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["応答例:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"code\": 0,\n    \"msg\": null,\n    \"data\": {\n        \"scope\": \"cloudphone\",\n        \"access_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOi...\",\n        \"token_type\": \"Bearer\",\n        \"expires_in\": 3600,\n        \"client_metadata\": {\n            \"name\": \"Example Team\"\n        }\n    },\n    \"requestId\": \"4b727b1d53a445d0a46389465b562360\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ステップ-3-アクセス-トークンを使用する","__idx":7},"children":["ステップ 3: アクセス トークンを使用する"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["すべての Open API リクエストの ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," ヘッダーにアクセス トークンを含めます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.morelogin.com/cloudphone/app/page \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_ACCESS_TOKEN\" \\\n  -d '{\n    \"pageNum\": 1,\n    \"pageSize\": 10\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["注"]},": アクセス トークンは ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["3600 秒"]}," (1 時間) 後に期限切れになります。現在のトークンの有効期限が切れたら、新しいトークンを要求します。"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"認証の比較","__idx":8},"children":["認証の比較"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"特徴"},"children":["特徴"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"ローカルAPI"},"children":["ローカルAPI"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"オープンAPI"},"children":["オープンAPI"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["方法"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["静的トークン (オプション)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["OAuth2アクセストークン"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["トークンの有効期間"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["永続的 (再生成されるまで)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1時間"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["入手場所"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["詳細ログインクライアント設定"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Exchange API ID + キー"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ヘッダー形式"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization: TOKEN"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization: Bearer TOKEN"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["必須"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["オプション (無効化可能)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["常に必須"]}]}]}]}]}]},"headings":[{"value":"認証","id":"認証","depth":1},{"value":"ローカルAPI認証","id":"ローカルapi認証","depth":2},{"value":"デフォルトモード（認証なし）","id":"デフォルトモード認証なし","depth":3},{"value":"認証の有効化","id":"認証の有効化","depth":3},{"value":"オープンAPI認証(OAuth2)","id":"オープンapi認証oauth2","depth":2},{"value":"ステップ 1: API ID と API キーを取得する","id":"ステップ-1-api-id-と-api-キーを取得する","depth":3},{"value":"ステップ 2: アクセス トークンを取得する","id":"ステップ-2-アクセス-トークンを取得する","depth":3},{"value":"ステップ 3: アクセス トークンを使用する","id":"ステップ-3-アクセス-トークンを使用する","depth":3},{"value":"認証の比較","id":"認証の比較","depth":2}],"frontmatter":{"seo":{"title":"認証"}},"lastModified":"2026-06-10T11:47:34.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/api-reference/getting-started/authentication","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}