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

Support profiles with nested fields #34

Open
frafra opened this issue Nov 1, 2019 · 1 comment
Open

Support profiles with nested fields #34

frafra opened this issue Nov 1, 2019 · 1 comment

Comments

@frafra
Copy link

frafra commented Nov 1, 2019

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:

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:

def user_json(self, user_data):
email = user_data[self.profile_api_mail_field]
user_name = user_data[self.profile_api_user_field]

I made a workaround for that, but it is not a generic fix: NINAnor@f86448f

@frafra
Copy link
Author

frafra commented Dec 15, 2021

Any feedback on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant