{"id":21514991,"url":"https://github.com/skyway/authentication-samples","last_synced_at":"2025-04-24T03:09:26.248Z","repository":{"id":65575837,"uuid":"594020509","full_name":"skyway/authentication-samples","owner":"skyway","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-21T05:58:24.000Z","size":378,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-24T03:09:20.129Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skyway.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-27T12:10:33.000Z","updated_at":"2025-04-21T05:58:22.000Z","dependencies_parsed_at":"2025-01-24T02:31:28.412Z","dependency_job_id":"5fbcc566-edb0-48aa-bc1c-159945b7d666","html_url":"https://github.com/skyway/authentication-samples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyway%2Fauthentication-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyway%2Fauthentication-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyway%2Fauthentication-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyway%2Fauthentication-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyway","download_url":"https://codeload.github.com/skyway/authentication-samples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250552074,"owners_count":21449165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T23:53:48.014Z","updated_at":"2025-04-24T03:09:26.236Z","avatar_url":"https://github.com/skyway.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SkyWay Authentication Sample\n\nこのリポジトリには、SkyWayで利用する認証情報を生成・取得するサンプルがあります。\n\nSkyWayにおけるエンドユーザーの認証・認可について、詳細は[開発者ドキュメントのSkyWay Auth Tokenのページ](https://skyway.ntt.com/ja/docs/user-guide/authentication/skyway-auth-token/)をご覧ください。\n\n## サーバーアプリケーション\n\n`/authenticate`にてPOSTリクエストを受け付け、認証情報の発行を行います。\n\n### NodeJSサーバー\n\nserver/nodejsディレクトリに移動して依存ライブラリをインストールしてください。\n次に、index.jsファイルをテキストエディタで開き、 `appId` と `secretKey` の各変数の値を自身のApp ID、Secret Keyに書き換えてファイルを保存してください。\nその後、 `npm start` コマンドでサーバーを起動してください。\nサーバーは8080ポートを使用します。\n\n```sh\ncd server/nodejs\nnpm i\nnpm start\n```\n\n### PHPサーバー\n\nserver/on-cloud-run-functions/phpディレクトリに移動して、[Composer](https://getcomposer.org/) で依存ライブラリをインストールしてください。\n次に、環境変数 `APP_ID` と `SECRET_KEY`、 `VALID_FIXED_SESSION_TOKEN` に値を設定してください。\n- `APP_ID` と `SECRET_KEY`は、それぞれ自身のApp ID、Secret Keyを設定してください。\n- `VALID_FIXED_SESSION_TOKEN`は、クライアントアプリケーションを検証する際に用いる固定値を設定してください。\n  - 後述のクライアントアプリケーションをそのまま使う場合は、[`4CXS0f19nvMJBYK05o3toTWtZF5Lfd2t6Ikr2lID`](https://github.com/skyway/authentication-samples/blob/ea675724d7458c0f765b018c1698980493f8b06b/client/index.js#L15)を設定してください。\n  - サンプルのため、クライアントアプリケーションからの[リクエストボディの sessionToken パラメーター](https://github.com/skyway/authentication-samples/blob/ea675724d7458c0f765b018c1698980493f8b06b/client/index.js#L15)と比較で検証する作りにしています。本番環境では、より高度な検証方法を用いられることが望ましいです。\n\n環境変数の設定ができない場合は、 .env.example ファイルの名前を .env に変更し、上記3変数に値を設定してファイルを保存してください。\nその後、環境変数`FUNCTION_TARGET`を設定し、`php -S localhost:8080` コマンドでローカルサーバーを起動してください。\nサーバーは8080ポートを使用します。\n\n```sh\ncd server/on-cloud-run-functions/php\ncomposer install\n\nFUNCTION_TARGET=main php -S localhost:8080 vendor/google/cloud-functions-framework/router.php\n```\n\n## クライアントアプリケーション\n\nサーバーアプリケーションにリクエストを行い、認証情報を取得します。\n\nclientディレクトリをホスティングし、ブラウザから`index.html`にアクセスしてください。\n\n### 操作方法\n\n1. Room Name、Member Nameのテキストボックスに文字列を入力します。\n2. Get credentialボタンを押下します。\n3. 認証情報の取得に成功すると、結果がCredentialのエリアにJSON形式で出力されます。\n    - `authToken`がアプリケーションからSkyWayを利用する際に必要となります\n4. Copy authToken to clipboardボタンを押下することで、クリップボードに `authToken`がコピーされます。\n\n### スクリーンショット\n\n![クライアントアプリケーションのスクリーンショット](./docs/img/screen-shot.png)\n\n## 公開リポジトリの運用方針について\n\nこのリポジトリは公開用のミラーリポジトリであり、こちらで開発は行いません。\n\n### Issue / Pull Request\n\n受け付けておりません。\n\nEnterpriseプランをご契約のお客様はテクニカルサポートをご利用ください。\n詳しくは[SkyWayサポート](https://support.skyway.ntt.com/hc/ja)をご確認ください。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyway%2Fauthentication-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyway%2Fauthentication-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyway%2Fauthentication-samples/lists"}