https://github.com/shubhamdutta2000/api-key-authentication-with-fastapi
API key-based authentication. This is authentication in the form of an arbitrary string with an arbitrary length, which gives access to an API.
https://github.com/shubhamdutta2000/api-key-authentication-with-fastapi
api-key-authentication authentication fastapi hacktoberfest postgresql
Last synced: 10 days ago
JSON representation
API key-based authentication. This is authentication in the form of an arbitrary string with an arbitrary length, which gives access to an API.
- Host: GitHub
- URL: https://github.com/shubhamdutta2000/api-key-authentication-with-fastapi
- Owner: Shubhamdutta2000
- Created: 2022-10-13T10:17:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-14T23:13:52.000Z (about 3 years ago)
- Last Synced: 2025-05-16T17:13:38.723Z (12 months ago)
- Topics: api-key-authentication, authentication, fastapi, hacktoberfest, postgresql
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Key Authentication with FastAPI
> This is authentication in the form of an arbitrary string of any length that allows access to an API.
## Feature:
- DB Connection Configuration with PostgresSQL and store all db creds in .env file and load it from seperate EnvConfig file.
- API Key Authentication for:
- Checking for a query parameter containing the API key
- Checking for a header containing the API key
- Checking for a cookie containing the API key
- GET Endpoint to expose all data with proper Pagination (of particular page and limit)
- When no query parameter is specified in the api, the page and limit are set by default which are stored in .env file.
## References:
- https://nilsdebruin.medium.com/fastapi-authentication-revisited-enabling-api-key-authentication-122dc5975680