Django Microsoft Authentication Backend version: 2.3.1
Django version: 2.0.13
Python version: 3.7
Operating System: macOS
Browser and version: all
Browser extensions/plugins you have installed: none
Description
The authentication fails because the kid returned from the token_endpoint is not included in the response of the jwks_uri.
The following code fails:
def get_claims(self, allow_refresh=True):
if self.token is None:
return None
token = self.token["id_token"].encode("utf8")
kid = jwt.get_unverified_header(token)["kid"]
jwk = None
public_key = None
for key in self.jwks:
if kid == key["kid"]: # <- never matches, there are 3 items in self.jwks
jwk = key
break
Operating System: macOS
Description
The authentication fails because the
kid
returned from thetoken_endpoint
is not included in the response of thejwks_uri
.The following code fails:
The config:
Do you have any idea what could cause
kids
not to match?Environment Setup Steps
Steps to Reproduce
Expected Result: User is created and logged in Actual Result: Failed to authenticate you for an unknown reason