Skip to content

Commit

Permalink
fix: handle with missing param about RelayState
Browse files Browse the repository at this point in the history
  • Loading branch information
zevitagem committed Aug 1, 2023
1 parent cf95380 commit 5808d6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion social_core/backends/saml.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,11 @@ def auth_complete(self, *args, **kwargs):
The user has been redirected back from the IdP and we should
now log them in, if everything checks out.
"""
idp_name = self.strategy.request_data()["RelayState"]
try:
idp_name = self.strategy.request_data()["RelayState"]
except KeyError:
raise AuthMissingParameter(self, "RelayState")

Check warning on line 308 in social_core/backends/saml.py

View check run for this annotation

Codecov / codecov/patch

social_core/backends/saml.py#L307-L308

Added lines #L307 - L308 were not covered by tests

idp = self.get_idp(idp_name)
auth = self._create_saml_auth(idp)
auth.process_response()
Expand Down

0 comments on commit 5808d6d

Please sign in to comment.