@@ -666,13 +666,12 @@ def _map_okta_user_profile_to_username(
666
666
self .config .okta_profile_to_username_regex ,
667
667
)
668
668
669
- # Converts Okta User Profile into a CorpUserInfo.
670
- def _map_okta_user_profile (self , profile : UserProfile ) -> CorpUserInfoClass :
671
- # TODO: Extract user's manager if provided.
672
- # Source: https://developer.okta.com/docs/reference/api/users/#default-profile-properties
673
- full_name = f"{ profile .firstName } { profile .lastName } "
674
- custom_properties = {
675
- k : v
669
+ def _map_okta_user_profile_custom_properties (
670
+ self , profile : UserProfile
671
+ ) -> Dict [str , str ]:
672
+ # filter out the common fields that are already mapped to the CorpUserInfo aspect and the private ones
673
+ return {
674
+ k : str (v )
676
675
for k , v in profile .__dict__ .items ()
677
676
if v
678
677
and k
@@ -685,7 +684,14 @@ def _map_okta_user_profile(self, profile: UserProfile) -> CorpUserInfoClass:
685
684
"countryCode" ,
686
685
"department" ,
687
686
]
687
+ and not k .startswith ("_" )
688
688
}
689
+
690
+ # Converts Okta User Profile into a CorpUserInfo.
691
+ def _map_okta_user_profile (self , profile : UserProfile ) -> CorpUserInfoClass :
692
+ # TODO: Extract user's manager if provided.
693
+ # Source: https://developer.okta.com/docs/reference/api/users/#default-profile-properties
694
+ full_name = f"{ profile .firstName } { profile .lastName } "
689
695
return CorpUserInfoClass (
690
696
active = True ,
691
697
displayName = (
@@ -698,7 +704,7 @@ def _map_okta_user_profile(self, profile: UserProfile) -> CorpUserInfoClass:
698
704
title = profile .title ,
699
705
countryCode = profile .countryCode ,
700
706
departmentName = profile .department ,
701
- customProperties = custom_properties ,
707
+ customProperties = self . _map_okta_user_profile_custom_properties ( profile ) ,
702
708
)
703
709
704
710
def _make_corp_group_urn (self , name : str ) -> str :
0 commit comments