kumidc/core/oidc/userinfo.py

12 lines
584 B
Python
Raw Normal View History

2022-08-02 09:49:45 +00:00
def userinfo(claims, user):
claims['email'] = user.email
2022-08-04 11:15:10 +00:00
claims['email_verified'] = bool(user.profile.email_verified)
2022-08-05 06:39:34 +00:00
claims['given_name'] = user.profile.first_name
2022-08-05 08:41:15 +00:00
claims['family_name'] = user.profile.last_name
2022-08-05 06:39:34 +00:00
claims['nickname'] = user.profile.nickname
claims['preferred_username'] = user.profile.preferred_username
claims['website'] = user.profile.website
2022-08-12 07:40:10 +00:00
claims['zoneinfo'] = str(user.profile.zoneinfo)
2022-08-05 06:39:34 +00:00
claims['phone_number'] = user.profile.phone_number
claims['phone_number_verified'] = user.profile.phone_number_verified
2022-08-02 09:49:45 +00:00
return claims