Skip to content

Commit

Permalink
fixed silentoverride issue
Browse files Browse the repository at this point in the history
  • Loading branch information
twocanoes committed Feb 6, 2024
1 parent dec4a69 commit 253a29c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Profile Manifest/com.twocanoes.xcreds.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>pfm_app_url</key>
<string>https://github.com/twocanoes/xcreds</string>
<key>pfm_description</key>
<string>XCreds 4.1 (6313) OAuth Settings</string>
<string>XCreds 4.1 (6315) OAuth Settings</string>
<key>pfm_documentation_url</key>
<string>https://twocanoes.com/knowledge-base/xcreds-admin-guide/#preferences</string>
<key>pfm_domain</key>
Expand Down
48 changes: 23 additions & 25 deletions XCredsLoginPlugIn/Mechanisms/XCredsBaseMechanism.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,44 +152,42 @@ import OpenDirectory
setHint(type: .adminPassword, hint: aPassword)
setHint(type: .passwordOverwrite, hint: true)


allowLogin()

}
let promptPasswordWindowController = VerifyLocalPasswordWindowController()
else {
let promptPasswordWindowController = VerifyLocalPasswordWindowController()

promptPasswordWindowController.showResetText=true
promptPasswordWindowController.showResetButton=true
promptPasswordWindowController.showResetText=true
promptPasswordWindowController.showResetButton=true


switch promptPasswordWindowController.promptForLocalAccountAndChangePassword(username: username, newPassword: password, shouldUpdatePassword: true) {
switch promptPasswordWindowController.promptForLocalAccountAndChangePassword(username: username, newPassword: password, shouldUpdatePassword: true) {


case .success(let enteredUsernamePassword):
TCSLogWithMark("setting original password to use to unlock keychain later")
case .success(let enteredUsernamePassword):
TCSLogWithMark("setting original password to use to unlock keychain later")

if let enteredUsernamePassword = enteredUsernamePassword {
setHint(type: .existingLocalUserPassword, hint:enteredUsernamePassword.password as Any )
}
if let enteredUsernamePassword = enteredUsernamePassword {
setHint(type: .existingLocalUserPassword, hint:enteredUsernamePassword.password as Any )
}

case .resetKeychainRequested(let usernamePasswordCredentials):

if let adminUsername = usernamePasswordCredentials?.username, let adminPassword = usernamePasswordCredentials?.password {
setHint(type: .adminUsername, hint:adminUsername )
setHint(type: .adminPassword, hint: adminPassword)
setHint(type: .passwordOverwrite, hint: true)
case .resetKeychainRequested(let usernamePasswordCredentials):

}
if let adminUsername = usernamePasswordCredentials?.username, let adminPassword = usernamePasswordCredentials?.password {
setHint(type: .adminUsername, hint:adminUsername )
setHint(type: .adminPassword, hint: adminPassword)
setHint(type: .passwordOverwrite, hint: true)

}

case .userCancelled:
return .failure("user cancelled")
case .error(let errMsg):
TCSLogWithMark("Error prompting: \(errMsg)")
return .failure(errMsg)

case .userCancelled:
return .failure("user cancelled")
case .error(let errMsg):
TCSLogWithMark("Error prompting: \(errMsg)")
return .failure(errMsg)
}
}

break
case .accountDoesNotExist:
TCSLogWithMark("user account doesn't exist yet")

Expand Down
12 changes: 6 additions & 6 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6313;
CURRENT_PROJECT_VERSION = 6318;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1477,7 +1477,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6313;
CURRENT_PROJECT_VERSION = 6318;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1598,7 +1598,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6313;
CURRENT_PROJECT_VERSION = 6318;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1635,7 +1635,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6313;
CURRENT_PROJECT_VERSION = 6318;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1785,7 +1785,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6313;
CURRENT_PROJECT_VERSION = 6318;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1827,7 +1827,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6313;
CURRENT_PROJECT_VERSION = 6318;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<key>auth_mech_fixup.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>6</integer>
<integer>7</integer>
</dict>
<key>authrights.xcscheme_^#shared#^_</key>
<dict>
Expand All @@ -42,7 +42,7 @@
<key>test.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>7</integer>
<integer>6</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down

0 comments on commit 253a29c

Please sign in to comment.