{"id":19208632,"url":"https://github.com/heiwa4126/sam-auth-coguserpool","last_synced_at":"2025-02-23T07:16:35.733Z","repository":{"id":111910547,"uuid":"444335763","full_name":"heiwa4126/sam-auth-coguserpool","owner":"heiwa4126","description":"Cognito Authorizerのサンプル","archived":false,"fork":false,"pushed_at":"2022-01-04T08:08:08.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T16:18:51.323Z","etag":null,"topics":["aws-lambda","cognito","example","sam"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heiwa4126.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-01-04T08:07:20.000Z","updated_at":"2022-01-04T08:11:50.000Z","dependencies_parsed_at":"2023-04-07T22:33:08.993Z","dependency_job_id":null,"html_url":"https://github.com/heiwa4126/sam-auth-coguserpool","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/heiwa4126%2Fsam-auth-coguserpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fsam-auth-coguserpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fsam-auth-coguserpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fsam-auth-coguserpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heiwa4126","download_url":"https://codeload.github.com/heiwa4126/sam-auth-coguserpool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240280984,"owners_count":19776418,"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":["aws-lambda","cognito","example","sam"],"created_at":"2024-11-09T13:27:14.013Z","updated_at":"2025-02-23T07:16:35.580Z","avatar_url":"https://github.com/heiwa4126.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sam-auth-coguserpool\n\nCognitoのuser poolでLambdaの認証を行うサンプル。\n\n一般的な Amazon Cognito シナリオ\nの\n[ユーザープールと共に API Gateway と Lambda を使用してリソースにアクセスする](https://docs.aws.amazon.com/ja_jp/cognito/latest/developerguide/cognito-scenarios.html#scenario-api-gateway)\nに相当する。\n\n\n# デプロイ\n\n## リソースのデプロイ\n\nSAMなので\n```sh\nsam build\nsam deploy --guided  # --guidedは最初の1回\n```\n\n## ユーザの作成\n\n```sh\ncp user_template.sh user.sh\nvim user.sh\n```\nでユーザ名(emailアドレス)とパスワード、名前と苗字を編集する。\n\n\n```sh\n./create_and_conferm_a_user.sh\n```\nを実行すると、ユーザ名(emailアドレス)に\n`Your verification code` という題名の\n\n\u003e Your confirmation code is 123456\n\nのようなメールが届くので、この6桁のコードを\n\n\u003e Check the mailbox and Enter verification code:\n\nのプロンプトのところへコピペしてEnter。これでユーザプールに認証済みのユーザができる。\n\n\n# テスト\n\n## 失敗するテスト\n\n認証無しでlambdaを呼び出す。\n\n```sh\n./call_lambda_without_auth.sh\n```\n\n\n## 認証付きテスト\n\nID Tokenを使ってlambdaを呼び出す。\n\n```sh\n./call_lambda.sh\n```\n\n\n# 削除\n\n```sh\nsam delete\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheiwa4126%2Fsam-auth-coguserpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheiwa4126%2Fsam-auth-coguserpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheiwa4126%2Fsam-auth-coguserpool/lists"}