-
Notifications
You must be signed in to change notification settings - Fork 169
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
Problems with mozilla-django-oidc callback #421
Comments
`Environment: Request Method: GET Django Version: 3.2.4 Traceback (most recent call last): Exception Type: JSONDecodeError at /oidc/callback/ |
Any chance you can display the corrupted json content? |
Back from holdays, gotta look into this again. in auth.py "get_userinfo", user_response.json() crashes - also whenever I'm trying to print it to the log, so the format conversion fails (sys.stderr.write(user_response.json() crashes with the same message). Any ideas on how to actually view the response object? |
resolved |
How did you resolve it? I'm having the same problem. Edit: My working code change below. (Works with Authelia OpenID provider.) In import json
def get_userinfo(self, access_token, id_token, payload):
"""Return user details dictionary. The id_token and payload are not used in
the default implementation, but may be used when overriding this method"""
user_response = requests.get(
self.OIDC_OP_USER_ENDPOINT,
headers={
'Authorization': 'Bearer {0}'.format(access_token)
},
verify=self.get_settings('OIDC_VERIFY_SSL', True),
timeout=self.get_settings('OIDC_TIMEOUT', None),
proxies=self.get_settings('OIDC_PROXY', None))
user_response.raise_for_status()
msg = user_response.text
utf8 = msg.encode('utf-8')
jws = JWS.from_compact(utf8)
jwsjson = json.loads(jws.payload)
return jwsjson |
Hi there! OIDC & django n00b here, so please bear with me.
Set up mozilla-django-oidc on a https apache server with rs256 and correct endpoints (OIDC_OP_JWKS_ENDPOINT,OIDC_RP_SIGN_ALGO,OIDC_OP_TOKEN_ENDPOINT, OIDC_OP_AUTHORIZATION_ENDPOINT) all set etc.
I manage to log in - but afterwards, the server crashes with a json format error (basically crashing on "self.user = auth.authenticate(**kwargs)" in the MDO views.py
I have no idea what is going on here, and I'm unable to find any information on google about what this error could mean - any tips would be helpful!
python 3.6, django 3.2.4, mozilla-django-oidc 1.2.4
The text was updated successfully, but these errors were encountered: