Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion confidential_backend/auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,16 @@ def authorize():

# todo: define fetch_token function that requests JSON (Accept: application/json header)
# https://github.com/lepture/authlib/blob/master/authlib/oauth2/client.py#L154
token_response = oauth.sof.authorize_access_token(_format='json')
try:
token_response = oauth.sof.authorize_access_token(_format='json')
except requests.exceptions.HTTPError as http_err:
# Log request details
req = http_err.response.request
current_app.logger.debug("HTTPError occurred getting access token")
current_app.logger.debug(f"Response Body: {http_err.response.content}")

raise http_err

extracted_id_token = extract_payload(token_response.get('id_token'))
username = extracted_id_token.get('preferred_username')

Expand Down
1 change: 1 addition & 0 deletions confidential_backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
SESSION_COOKIE_DOMAIN = os.getenv("SESSION_COOKIE_DOMAIN")
SESSION_COOKIE_SAMESITE = os.getenv("SESSION_COOKIE_SAMESITE", 'Lax')
SESSION_COOKIE_SECURE = os.getenv("SESSION_COOKIE_SECURE", 'false').lower() == 'true'
SESSION_COOKIE_PARTITIONED = os.getenv("SESSION_COOKIE_PARTITIONED", 'false').lower() == 'true'

REQUEST_CACHE_URL = os.environ.get('REQUEST_CACHE_URL', 'redis://localhost:6379/0')
REQUEST_CACHE_EXPIRE = 24 * 60 * 60 # 24 hours
Expand Down
2 changes: 1 addition & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ flask==3.1.2
# flask-session
flask-cors==4.0.1
# via confidential_backend (setup.cfg)
flask-session==0.8.0
flask-session @ git+https://github.com/uwcirg/flask-session.git@feature/cookie-partitioned-attribute
# via confidential_backend (setup.cfg)
gunicorn==20.1.0
# via confidential_backend (setup.cfg)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ flask==3.1.2
# flask-session
flask-cors==4.0.1
# via confidential_backend (setup.cfg)
flask-session==0.8.0
flask-session @ git+https://github.com/uwcirg/flask-session.git@feature/cookie-partitioned-attribute
# via confidential_backend (setup.cfg)
gunicorn==20.1.0
# via confidential_backend (setup.cfg)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install_requires =
cachelib==0.1.1
celery==5.5.3
flask-cors==4.0.1
flask-session==0.8.0
flask-session @ git+https://github.com/uwcirg/flask-session.git@feature/cookie-partitioned-attribute
flask==3.1.2
gunicorn==20.1.0
python-jose[cryptography]==3.2.0
Expand Down