Skip to content

Commit

Permalink
Don't fail, but issue a warning when detecting redirect fails
Browse files Browse the repository at this point in the history
  • Loading branch information
danchr committed Feb 28, 2023
1 parent 913e382 commit 2840165
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions openconnect_sso/authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ async def authenticate(self, display_mode):
def _detect_authentication_target_url(self):
# Follow possible redirects in a GET request
# Authentication will occur using a POST request on the final URL
response = self.session.get(self.host.vpn_url)
response.raise_for_status()
self.host.address = response.url
try:
response = self.session.get(self.host.vpn_url)
response.raise_for_status()
self.host.address = response.url
except Exception:
logger.warn("Failed to check for redirect")
self.host.address = self.host.vpn_url
logger.debug("Auth target url", url=self.host.vpn_url)

def _start_authentication(self):
Expand Down

0 comments on commit 2840165

Please sign in to comment.