Skip to content

Commit

Permalink
removed shouldFindPasswordElement since that is defaulit fallback beh…
Browse files Browse the repository at this point in the history
…avior
  • Loading branch information
twocanoes committed May 24, 2023
1 parent 6717b3a commit 2825ee7
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 33 deletions.
12 changes: 0 additions & 12 deletions Profile Manifest/com.twocanoes.xcreds.plist
Original file line number Diff line number Diff line change
Expand Up @@ -684,18 +684,6 @@ A profile can consist of payloads with different version numbers. For example, c
<key>pfm_type</key>
<string>string</string>
</dict>
<dict>
<key>pfm_description</key>
<string>Selects the password element field in the web page by finding a form element that has bullets (input is password)</string>
<key>pfm_documentation_url</key>
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#shouldfindpasswordelement</string>
<key>pfm_name</key>
<string>shouldFindPasswordElement</string>
<key>pfm_title</key>
<string>shouldFindPasswordElement</string>
<key>pfm_type</key>
<string>boolean</string>
</dict>
<dict>
<key>pfm_default</key>
<string>given_name</string>
Expand Down
2 changes: 1 addition & 1 deletion XCreds/PrefKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

enum PrefKeys: String {
case clientID, clientSecret, password="local password",discoveryURL, redirectURI, scopes, accessToken, idToken, refreshToken, tokenEndpoint, expirationDate, invalidToken, refreshRateHours, showDebug, verifyPassword, shouldShowQuitMenu, shouldShowPreferencesOnStart, shouldSetGoogleAccessTypeToOffline, passwordChangeURL, shouldShowAboutMenu, username, idpHostName, passwordElementID, shouldFindPasswordElement, shouldShowVersionInfo, shouldShowSupportStatus,shouldShowConfigureWifiButton,shouldShowMacLoginButton, loginWindowBackgroundImageURL, shouldShowCloudLoginByDefault,idpHostNames,autoRefreshLoginTimer, loginWindowWidth, loginWindowHeight, shouldShowRefreshBanner, shouldSwitchToLoginWindowWhenLocked,accounts = "Accounts",
case clientID, clientSecret, password="local password",discoveryURL, redirectURI, scopes, accessToken, idToken, refreshToken, tokenEndpoint, expirationDate, invalidToken, refreshRateHours, showDebug, verifyPassword, shouldShowQuitMenu, shouldShowPreferencesOnStart, shouldSetGoogleAccessTypeToOffline, passwordChangeURL, shouldShowAboutMenu, username, idpHostName, passwordElementID, shouldShowVersionInfo, shouldShowSupportStatus,shouldShowConfigureWifiButton,shouldShowMacLoginButton, loginWindowBackgroundImageURL, shouldShowCloudLoginByDefault,idpHostNames,autoRefreshLoginTimer, loginWindowWidth, loginWindowHeight, shouldShowRefreshBanner, shouldSwitchToLoginWindowWhenLocked,accounts = "Accounts",
windowSignIn = "WindowSignIn", settingsOverrideScriptPath, localAdminUserName, localAdminPassword
case actionItemOnly = "ActionItemOnly"
case aDDomain = "ADDomain"
Expand Down
19 changes: 1 addition & 18 deletions XCreds/WebViewWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,11 @@ extension WebViewWindowController: WKNavigationDelegate {
idpHostNames=[idpHostName]
}
let passwordElementID:String? = DefaultsOverride.standardOverride.value(forKey: PrefKeys.passwordElementID.rawValue) as? String
let shouldFindPasswordElement:Bool? = DefaultsOverride.standardOverride.bool(forKey: PrefKeys.shouldFindPasswordElement.rawValue)

TCSLogWithMark("inserting javascript to get password")
webView.evaluateJavaScript("result", completionHandler: { response, error in
if error != nil {
// TCSLogWithMark(error?.localizedDescription ?? "unknown error")
TCSLogWithMark(error?.localizedDescription ?? "unknown error")
}
else {
if let responseDict = response as? NSDictionary, let ids = responseDict["ids"] as? Array<String>, let passwords = responseDict["passwords"] as? Array<String>, passwords.count>0 {
Expand Down Expand Up @@ -154,22 +153,6 @@ extension WebViewWindowController: WKNavigationDelegate {
self.password=passwords[2]

}
//
if shouldFindPasswordElement == true {
if passwords.count==1 {
TCSLogWithMark("found 1 password field. setting")
TCSLogWithMark("========= password set===========")
self.password=passwords[0]
}
else {
TCSLogErrorWithMark("password not set. Found: \(ids)")
return

}
}
else {
TCSLogWithMark("password not captured")
}
}
}
})
Expand Down
2 changes: 0 additions & 2 deletions XCreds/defaults.plist
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
<true/>
<key>shouldShowVersionInfo</key>
<true/>
<key>shouldFindPasswordElement</key>
<true/>
<key>shouldShowSupportStatus</key>
<string>1</string>
<key>shouldShowConfigureWifiButton</key>
Expand Down
Binary file not shown.

0 comments on commit 2825ee7

Please sign in to comment.