Skip to content

Commit

Permalink
fixed passwordElementID preference can cause issue with setting local…
Browse files Browse the repository at this point in the history
… password #161
  • Loading branch information
twocanoes committed Jan 27, 2024
1 parent 6205cb0 commit 5b54737
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 12 deletions.
8 changes: 5 additions & 3 deletions XCreds/StatusMenuController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ class StatusMenuController: NSObject, NSMenuItemValidation {
quitMenuItemSeparator.isHidden=true

}
quitMenuItem.isHidden=false
quitMenuItemSeparator.isHidden=false

else {
quitMenuItem.isHidden=false
quitMenuItemSeparator.isHidden=false
}

case .PasswordExpires:

if let passwordExpires = mainController?.passwordExpires {
Expand Down
2 changes: 1 addition & 1 deletion XCreds/WebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ extension WebViewController: WKNavigationDelegate {

}
func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
TCSLogWithMark(error.localizedDescription)
TCSLogWithMark("Redirect error. Probably safe to ignore since we don't actually follow the redirect:\(error.localizedDescription)")
}
func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) {
TCSLogWithMark("WebDel:: Did Receive Redirect for: \(webView.url?.absoluteString ?? "None")")
Expand Down
7 changes: 7 additions & 0 deletions XCredsLoginPlugIn/Mechanisms/XCredsBaseMechanism.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ import OpenDirectory
return .failure("username or password are not set")
}

if password.isEmpty {
TCSLogWithMark("Empty password. Failing");
let message = "Password not set. Verify username mapping in configuration is correct and you are not using passwordless login."
denyLogin(message: message)
return .failure(message)

}
TCSLogWithMark("checking local password for username:\(username) and password length: \(password.count)");

let passwordCheckStatus = PasswordUtils.isLocalPasswordValid(userName: username, userPass: password)
Expand Down
12 changes: 6 additions & 6 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6265;
CURRENT_PROJECT_VERSION = 6269;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1473,7 +1473,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6265;
CURRENT_PROJECT_VERSION = 6269;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1594,7 +1594,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6265;
CURRENT_PROJECT_VERSION = 6269;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1631,7 +1631,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6265;
CURRENT_PROJECT_VERSION = 6269;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1781,7 +1781,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6265;
CURRENT_PROJECT_VERSION = 6269;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1823,7 +1823,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6265;
CURRENT_PROJECT_VERSION = 6269;
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 @@ -82,6 +82,38 @@
endingLineNumber = "34"
landmarkName = "selectLocalAccountAndUpdate(newPassword:)"
landmarkType = "7">
<Locations>
<Location
uuid = "D9EEE7A5-0569-4F83-88AD-306E44567BFC - 87eebe3b1909fbb7"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "static XCreds.SelectLocalAccountWindowController.selectLocalAccountAndUpdate(newPassword: Swift.String) -&gt; XCreds.SelectLocalAccountWindowController.VerifyLocalCredentialsResult"
moduleName = "XCreds"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/tperfitt/Documents/Projects/xcreds/XCreds/SelectLocalAccountWindowController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "34"
endingLineNumber = "34"
offsetFromSymbolStart = "856">
</Location>
<Location
uuid = "D9EEE7A5-0569-4F83-88AD-306E44567BFC - bddba436c7839a5a"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "closure #1 @Swift.MainActor () -&gt; () in static XCreds.SelectLocalAccountWindowController.selectLocalAccountAndUpdate(newPassword: Swift.String) -&gt; XCreds.SelectLocalAccountWindowController.VerifyLocalCredentialsResult"
moduleName = "XCreds"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/tperfitt/Documents/Projects/xcreds/XCreds/SelectLocalAccountWindowController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "35"
endingLineNumber = "35"
offsetFromSymbolStart = "48">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
Expand All @@ -100,5 +132,21 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "6C3BB5C8-F87C-4280-A376-6FF3005B8236"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/StatusMenuController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "108"
endingLineNumber = "108"
landmarkName = "validateMenuItem(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
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 5b54737

Please sign in to comment.