{"id":21731048,"url":"https://github.com/raphaelbh/aws-apigateway-authorizer","last_synced_at":"2026-05-06T23:42:46.027Z","repository":{"id":135190764,"uuid":"452656442","full_name":"raphaelbh/aws-apigateway-authorizer","owner":"raphaelbh","description":"Proof of concept to demonstrate how to create a API Authorizer with Cognito.","archived":false,"fork":false,"pushed_at":"2022-04-13T21:39:14.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T20:11:28.612Z","etag":null,"topics":["api","apigateway","authentication","authorizer","aws","cloudformation","cognito","docker","jwt"],"latest_commit_sha":null,"homepage":"","language":"Python","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/raphaelbh.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-27T11:31:31.000Z","updated_at":"2022-03-22T03:05:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"3cd126ae-5c4f-434f-a440-feef32ca3f7a","html_url":"https://github.com/raphaelbh/aws-apigateway-authorizer","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/raphaelbh%2Faws-apigateway-authorizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelbh%2Faws-apigateway-authorizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelbh%2Faws-apigateway-authorizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelbh%2Faws-apigateway-authorizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelbh","download_url":"https://codeload.github.com/raphaelbh/aws-apigateway-authorizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244708008,"owners_count":20496826,"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":["api","apigateway","authentication","authorizer","aws","cloudformation","cognito","docker","jwt"],"created_at":"2024-11-26T04:19:29.453Z","updated_at":"2026-05-06T23:42:45.986Z","avatar_url":"https://github.com/raphaelbh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS API Authorizer + Cognito\n\n[![Project Status](https://img.shields.io/static/v1?label=project%20status\u0026message=complete\u0026color=success\u0026style=flat-square)](#)\n\nProof of concept to demonstrate how to create a API Authorizer with Cognito.\n\nTech Stack:\n- ApiGateway\n- Cognito\n- JWT\n\n\n## Requirements\n\n[![docker](https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge\u0026logo=docker\u0026logoColor=white)](https://www.docker.com/)\n\n\n## Installation\n\nUpdate `bootstrap/docker-compose.yaml` with the correct env variables: \n- `AWS_ACCESS_KEY_ID`\n- `AWS_SECRET_ACCESS_KEY`\n- `AWS_DEFAULT_REGION`\n\n```bash\n$ (cd bootstrap \u0026\u0026 docker-compose up)\n```\n\n \n## Usage\n\nSet the follow env variables (application/.env)  \n- `AWS_ACCESS_KEY_ID`\n- `AWS_SECRET_ACCESS_KEY`\n- `AWS_DEFAULT_REGION`\n- `USER_POOL_ID`\n- `USER_POOL_CLIENT_ID`\n\nGetting access token\n\n```python\nimport application.cognito as cognito\n\nuser = {\n    'username': 'raphaeldias.ti@gmail.com',\n    'password': 'Mudar@123'\n}\n\njwt = cognito.initiate_auth(user)\naccess_token = jwt['body']['access_token'] \n```\n\nRequesting api\n\n```python\nimport requests\n\nheaders = {'Authorization' : 'Bearer ' + $access_token}\nresponse = requests.get($API_URL, headers=headers)\n```\n\n\n## Running Tests\n\nSet the follow env variables (tests/.env)  \n- `API_URL`\n\n```bash\n$ export PYTHONPATH=application \n$ pytest --cache-clear tests/\n```\n\n## Tech Stack\n\n[![docker](https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge\u0026logo=docker\u0026logoColor=white)](https://www.docker.com/)\n[![python](https://img.shields.io/badge/Python-FFD43B?style=for-the-badge\u0026logo=python\u0026logoColor=blue)](https://www.python.org/)\n[![aws](https://img.shields.io/badge/Amazon_AWS-FF9900?style=for-the-badge\u0026logo=amazonaws\u0026logoColor=white)](https://aws.amazon.com/)\n\n\n## Reference\n\n- https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html\n\n\n## Feedback\n\n\nIf you have any feedback, please contact me at raphaeldias.ti@gmail.com\n\n[![github](https://img.shields.io/badge/GitHub-100000?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/raphaelbh)\n[![linkedin](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://www.linkedin.com/in/raphaelbh/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelbh%2Faws-apigateway-authorizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelbh%2Faws-apigateway-authorizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelbh%2Faws-apigateway-authorizer/lists"}