Open frafra opened 5 years ago
Hi, some providers do not reply with a flat JSON; for example, dataporten.no has a /userinfo endpoint where the user's details are stored under user:
/userinfo
user
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "user": { "userid": "...", "userid_sec": ["feide:..."], "name": "...", "email": "...", "profilephoto": "p:..." }, "audience": "..." }
Source: https://docs.feide.no/developer_oauth/technical_details/oauth_authentication.html
The user_json function assumes a flat JSON instead:
user_json
https://github.com/conwetlab/ckanext-oauth2/blob/e68dd2664229b7563d77b2c8fc869fe57b747c88/ckanext/oauth2/oauth2.py#L173-L175
I made a workaround for that, but it is not a generic fix: https://github.com/NINAnor/ckanext-oauth2/commit/f86448f5cb0c30b981ea59bec5090112a4553e76
Any feedback on that?
Hi, some providers do not reply with a flat JSON; for example, dataporten.no has a
/userinfo
endpoint where the user's details are stored underuser
:Source: https://docs.feide.no/developer_oauth/technical_details/oauth_authentication.html
The
user_json
function assumes a flat JSON instead:https://github.com/conwetlab/ckanext-oauth2/blob/e68dd2664229b7563d77b2c8fc869fe57b747c88/ckanext/oauth2/oauth2.py#L173-L175
I made a workaround for that, but it is not a generic fix: https://github.com/NINAnor/ckanext-oauth2/commit/f86448f5cb0c30b981ea59bec5090112a4553e76