Skip to content

Commit

Permalink
renamed mapped prefs with a prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
twocanoes committed Nov 9, 2022
1 parent ecac400 commit aadd144
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions Profile Manifest/com.twocanoes.xcreds.plist
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ A profile can consist of payloads with different version numbers. For example, c
<key>pfm_documentation_url</key>
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#oidcmappingfirstname</string>
<key>pfm_name</key>
<string>firstname</string>
<string>map_firstname</string>
<key>pfm_note</key>
<string>Map firstName to OIDC claim</string>
<key>pfm_title</key>
Expand All @@ -548,7 +548,7 @@ A profile can consist of payloads with different version numbers. For example, c
<key>pfm_documentation_url</key>
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#oidcmappinglastname</string>
<key>pfm_name</key>
<string>lastname</string>
<string>map_lastname</string>
<key>pfm_note</key>
<string>Map lastName to OIDC claim</string>
<key>pfm_title</key>
Expand All @@ -564,7 +564,7 @@ A profile can consist of payloads with different version numbers. For example, c
<key>pfm_documentation_url</key>
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#oidcmappingfullname</string>
<key>pfm_name</key>
<string>fullname</string>
<string>map_fullname</string>
<key>pfm_note</key>
<string>Map fullName to OIDC claim</string>
<key>pfm_title</key>
Expand All @@ -578,9 +578,9 @@ A profile can consist of payloads with different version numbers. For example, c
<key>pfm_description</key>
<string>Local DS to OIDC Mapping for Name</string>
<key>pfm_documentation_url</key>
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#oidcmappingusername</string>
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#oidcmappinglusername</string>
<key>pfm_name</key>
<string>username</string>
<string>map_username</string>
<key>pfm_note</key>
<string>Map Username to OIDC claim</string>
<key>pfm_title</key>
Expand Down
8 changes: 4 additions & 4 deletions Sample Profile/xcreds_example_azure.mobileconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
<string>profile openid email offline_access</string>
<key>shouldShowQuitMenu</key>
<false/>
<key>firstname</key>
<key>map_firstname</key>
<string>given_name</string>
<key>fullname</key>
<key>map_fullname</key>
<string>name</string>
<key>lastname</key>
<key>map_lastname</key>
<string>family_name</string>
<key>username</key>
<key>map_username</key>
<string>name</string>
</dict>
</array>
Expand Down
8 changes: 4 additions & 4 deletions Sample Profile/xcreds_example_google.mobileconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
<string>profile openid email</string>
<key>shouldSetGoogleAccessTypeToOffline</key>
<true/>
<key>firstname</key>
<key>map_firstname</key>
<string>given_name</string>
<key>fullname</key>
<key>map_fullname</key>
<string>name</string>
<key>lastname</key>
<key>map_lastname</key>
<string>family_name</string>
<key>username</key>
<key>map_username</key>
<string>name</string>
</dict>
</array>
Expand Down
8 changes: 4 additions & 4 deletions XCredsLoginPlugIn/LoginWindow/LoginWebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class LoginWebViewController: WebViewController {
if let defaultsUsername = defaultsUsername {
username = defaultsUsername
}
else if let idTokenInfo = idTokenInfo, let mapKey = UserDefaults.standard.object(forKey: "username") as? String, mapKey.count>0, let mapValue = idTokenInfo[mapKey] as? String {
else if let idTokenInfo = idTokenInfo, let mapKey = UserDefaults.standard.object(forKey: "map_username") as? String, mapKey.count>0, let mapValue = idTokenInfo[mapKey] as? String {
//we have a mapping for username, so use that.

username = mapValue
Expand Down Expand Up @@ -184,7 +184,7 @@ class LoginWebViewController: WebViewController {
}

//full name
if let idTokenInfo = idTokenInfo, let mapKey = UserDefaults.standard.object(forKey: "fullname") as? String, mapKey.count>0, let mapValue = idTokenInfo[mapKey] as? String {
if let idTokenInfo = idTokenInfo, let mapKey = UserDefaults.standard.object(forKey: "map_fullname") as? String, mapKey.count>0, let mapValue = idTokenInfo[mapKey] as? String {
//we have a mapping so use that.
TCSLogWithMark("full name mapped to: \(mapKey)")

Expand All @@ -198,7 +198,7 @@ class LoginWebViewController: WebViewController {
}

//first name
if let idTokenInfo = idTokenInfo, let mapKey = UserDefaults.standard.object(forKey: "firstname") as? String, mapKey.count>0, let mapValue = idTokenInfo[mapKey] as? String {
if let idTokenInfo = idTokenInfo, let mapKey = UserDefaults.standard.object(forKey: "map_firstname") as? String, mapKey.count>0, let mapValue = idTokenInfo[mapKey] as? String {
//we have a mapping for username, so use that.
TCSLogWithMark("first name mapped to: \(mapKey)")

Expand All @@ -211,7 +211,7 @@ class LoginWebViewController: WebViewController {
}
//last name

if let idTokenInfo = idTokenInfo, let mapKey = UserDefaults.standard.object(forKey: "lastname") as? String, mapKey.count>0, let mapValue = idTokenInfo[mapKey] as? String {
if let idTokenInfo = idTokenInfo, let mapKey = UserDefaults.standard.object(forKey: "map_lastname") as? String, mapKey.count>0, let mapValue = idTokenInfo[mapKey] as? String {
//we have a mapping for lastName, so use that.
TCSLogWithMark("last name mapped to: \(mapKey)")

Expand Down
Binary file not shown.

0 comments on commit aadd144

Please sign in to comment.