jetbridge / flask_cognito

Flask authentication with JWT against AWS Cognito
MIT License
94 stars 30 forks source link

Cognito with API keys #12

Open ardian-c opened 3 years ago

ardian-c commented 3 years ago

Hi,

Thank you for this helpful package.

I'm trying to integrate an API that wants to use the same endpoints as the web application does. Currently, with the auth required decorator, these methods expect a certain authentication header to be sent, and that to be valid with Cognito. Is there a way I can bypass the decorator by validating the API key instead of the authentication header?

Thanks

speedhawk21 commented 3 years ago

If you're using an API key to provide authenticated access, you wouldn't need Cognito. You can simply store the API key in your database and use a lookup.

Here's some helpful information to create a decorator using an api key: