Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip validation of JWT "aud" claim #2422

Merged
merged 1 commit into from
Mar 30, 2022
Merged
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
10 changes: 8 additions & 2 deletions service/esiAccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ def token_call(self, values):

def validate_eve_jwt(self, jwt_token):
"""Validate a JWT token retrieved from the EVE SSO.

Ignores the `aud` claim in token due to avoid unexpected breaking
changes to ESI.

Args:
jwt_token: A JWT token originating from the EVE SSO
Returns
Expand All @@ -235,7 +239,9 @@ def validate_eve_jwt(self, jwt_token):
jwt_token,
jwk_set,
algorithms=jwk_set["alg"],
issuer=[self.server_base.sso, "https://%s" % self.server_base.sso]
issuer=[self.server_base.sso, "https://%s" % self.server_base.sso],
# ignore "aud" claim: https://tweetfleet.slack.com/archives/C30KX8UUX/p1648495011905969
options={"verify_aud": False}
)
except ExpiredSignatureError as e:
raise GenericSsoError("The JWT token has expired: {}".format(str(e)))
Expand Down Expand Up @@ -305,4 +311,4 @@ def postFitting(self, char, json_str):
return self.post(char, EsiEndpoints.CHAR_FITTINGS.value, json_str, character_id=char.characterID)

def delFitting(self, char, fittingID):
return self.delete(char, EsiEndpoints.CHAR_DEL_FIT.value, character_id=char.characterID, fitting_id=fittingID)
return self.delete(char, EsiEndpoints.CHAR_DEL_FIT.value, character_id=char.characterID, fitting_id=fittingID)