-
- Downloads
provide an initial implementation
Provides a MVP implementation of a login and consent webapp. The emphasis here is on the "M". In particular we hard-code the list of supported scopes pending some API Gateway-side work (#3). The actual functionality of the app is in login/views.py and login/gateway.py. The remainder of the app is various bits of Django ceremony to wire those things together. I've tried to minimise the required settings. In particular we make use of the OpenID discovery endpoint to configure a lot of the OAuth2-related settings. A required setting includes the expected audience for the session id JWT from the Gateway. It is tempting to form this dynamically from the incoming request but that puts something which is used for token verification under the control of the incoming request's headers which risks confused-deputy style attacks[1]. Despite being functional and deployable as is, this app needs some further work. We implement the webapp using the traditional Project Light templates for speed of implementation. The UI needs a designer's eye (#4). If the requested scopes include "profile" then we fetch very basic user claims from Lookup. This is essentially just the display name at the moment. We can add given names, surnames, profile pictures, etc at a later date (#1). Most importantly, I think this app is an opportunity to require 2SV from the get-go for applications using the API Gateway. I've opened (#2) to track this since it's not part of the MVP but I think it'd be a good thing to implement ASAP. Part of https://gitlab.developers.cam.ac.uk/uis/devops/api/gateway-ops/-/issues/66 [1] https://en.wikipedia.org/wiki/Confused_deputy_problem
Showing
- Dockerfile 4 additions, 0 deletionsDockerfile
- LICENSE 21 additions, 0 deletionsLICENSE
- README.md 53 additions, 65 deletionsREADME.md
- compose/tox.env 7 additions, 2 deletionscompose/tox.env
- doc/conf.py 1 addition, 1 deletiondoc/conf.py
- doc/login_and_consent.rst 18 additions, 2 deletionsdoc/login_and_consent.rst
- login/__init__.py 28 additions, 1 deletionlogin/__init__.py
- login/defaultsettings.py 1 addition, 0 deletionslogin/defaultsettings.py
- login/gateway.py 185 additions, 0 deletionslogin/gateway.py
- login/scopes.py 40 additions, 0 deletionslogin/scopes.py
- login/systemchecks.py 5 additions, 1 deletionlogin/systemchecks.py
- login/templates/400.html 6 additions, 0 deletionslogin/templates/400.html
- login/templates/403.html 6 additions, 0 deletionslogin/templates/403.html
- login/templates/404.html 6 additions, 0 deletionslogin/templates/404.html
- login/templates/500.html 6 additions, 0 deletionslogin/templates/500.html
- login/templates/login/_layout.html 20 additions, 0 deletionslogin/templates/login/_layout.html
- login/templates/login/consent.html 51 additions, 0 deletionslogin/templates/login/consent.html
- login/templates/login/deniedconsent.html 8 additions, 0 deletionslogin/templates/login/deniedconsent.html
- login/tests/__init__.py 86 additions, 0 deletionslogin/tests/__init__.py
- login/tests/test_gateway_session.py 29 additions, 0 deletionslogin/tests/test_gateway_session.py
Loading
Please register or sign in to comment