Skip to content

Commit

Permalink
added additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
P-T-I committed Jul 26, 2022
1 parent dae6590 commit 876f49c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4
2.5
2 changes: 1 addition & 1 deletion spectacles/webapp/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4
2.5
6 changes: 4 additions & 2 deletions spectacles/webapp/token_auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def authenticate(auth_dict, get_data):

if config.OPENID_LOGIN:
logger.info("Authenticating against OIDC provider...")

logger.info(f"Issuer: {oidc.client_secrets.get('issuer')}")
# Check credentials against OIDC provider
with requests.session() as session:
headers = {"Content-Type": "application/x-www-form-urlencoded"}
Expand Down Expand Up @@ -97,10 +99,10 @@ def authenticate(auth_dict, get_data):

return True, get_data
elif str(result.status_code).startswith("5"):
logger.error(f"{result}")
logger.error(f"{result} --> {result.content.decode('utf-8')}")
raise ConnectionError
elif str(result.status_code).startswith("4"):
logger.error(f"{result}")
logger.error(f"{result} --> {result.content.decode('utf-8')}")
raise ConnectionRefusedError

else:
Expand Down

0 comments on commit 876f49c

Please sign in to comment.