Created
July 17, 2019 17:26
-
-
Save jredrejo/c3e250f5e5f224ba02715be8c51b5b38 to your computer and use it in GitHub Desktop.
un-women oidc email hack
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
diff --git a/kolibri/plugins/oidc_provider_plugin/__init__.py b/kolibri/plugins/oidc_provider_plugin/__init__.py | |
index 0276a6d09..2afa7693b 100644 | |
--- 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) | |
+ 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