Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
## Flask auth options for ADAPTS
2 factor authorization should be implemented alongside any main signin method.
Something like [this](
### Oauth2 (SSO)
Reuires a few things.
- A trusted Oauth2 server
- This could be a hassle and vector of attack
- If we wanted to roll our own this is a [good starting point](
- On the app server, it would be something like this
- Nice because you can define scopes which allows for easy resource management.
- Battletested
- Can be dockerized
- External authorization server (attac vector)
- Source of weird network bugs
- Distributed logs (need for log aggregation)
I think you could run the oauth2 server on the same server, maybe a VLAN or something. More on that [here](
### Username/Password combo
Use [Flask-Login]( as starting point
Subclass users to build out auth
- Simple to implement
- Lots of documentation around it with Flask
- localization support out of box
- None as long as 2fa implemented or strict policies around session management
Both of the methods above support the ORM sqlalchemy however some of the more critical auth stuff should be raw queuries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment