Created
August 13, 2020 18:23
-
-
Save jredrejo/64ce2b0b0ac1e8ea2342a0bd8cf6e63e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/kolibri/plugins/oidc_provider_plugin/__init__.py | |
+++ b/kolibri/plugins/oidc_provider_plugin/__init__.py | |
@@ -1,6 +1,13 @@ | |
+import os | |
+ | |
+ | |
def kolibri_userinfo(claims, user): | |
""" | |
Fill claims with the information available in the Kolibri database | |
""" | |
claims["name"] = user.full_name | |
+ COUNTRY = os.environ.get("COUNTRY", None) | |
+ claims["zoneinfo"] = user.facility.id | |
+ if COUNTRY: | |
+ claims["email"] = "{username}@{country}.org".format(username=user.username, country=COUNTRY) | |
return claims |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment