Skip to content

Commit

Permalink
fixed issue with google redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
twocanoes committed Jun 4, 2024
1 parent 32fd876 commit e2daed1
Show file tree
Hide file tree
Showing 15 changed files with 98 additions and 88 deletions.
8 changes: 4 additions & 4 deletions DefaultsOverride.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ public class DefaultsOverride: UserDefaults {

let scriptRes=cliTask(prefScriptPath)

if scriptRes.count==0{
TCSLogErrorWithMark("script did not return anything")
return
}
if scriptRes.count==0{
TCSLogErrorWithMark("script did not return anything")
return
}
TCSLogWithMark()
guard let rawData = scriptRes.data(using: .utf8) else {
TCSLogErrorWithMark("could not convert raw data");
Expand Down
4 changes: 2 additions & 2 deletions NomadLogin/LocalCheckAndMigrate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ class LocalCheckAndMigrate : NSObject, DSQueryable {
else
{
if let kerberosPrincipalName = kerberosPrincipalName, let foundRecord = try? getUserRecord(kerberosPrincipalNameToFind: kerberosPrincipalName) {
user = foundRecord.recordName
user = foundRecord.recordName
}
}
}
let shouldPromptToMigrate = DefaultsOverride.standardOverride.bool(forKey: PrefKeys.shouldPromptForMigration.rawValue)

// check local user pass to see if user exists
Expand Down
6 changes: 3 additions & 3 deletions Profile Manifest/com.twocanoes.xcreds.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<key>pfm_app_url</key>
<string>https://github.com/twocanoes/xcreds</string>
<key>pfm_description</key>
<string>XCreds 4.1 (6374) OAuth Settings</string>
<string>XCreds 4.1 (6408) OAuth Settings</string>
<key>pfm_documentation_url</key>
<string>https://twocanoes.com/knowledge-base/xcreds-admin-guide/#preferences</string>
<key>pfm_domain</key>
<string>com.twocanoes.xcreds</string>
<key>pfm_format_version</key>
<integer>1</integer>
<key>pfm_last_modified</key>
<date>2024-02-24T15:30:20Z</date>
<date>2024-04-22T17:39:46Z</date>
<key>pfm_platforms</key>
<array>
<string>macOS</string>
Expand Down Expand Up @@ -1347,6 +1347,6 @@ changing “passwordID” to the correct element ID. If the value you typed into
<key>pfm_unique</key>
<false/>
<key>pfm_version</key>
<integer>7</integer>
<integer>8</integer>
</dict>
</plist>
4 changes: 4 additions & 0 deletions Shared/Tokens.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ struct Creds {

return (self.accessToken != nil) && (self.refreshToken != nil)
}
func hasAccess() -> Bool {

return (self.accessToken != nil)
}

}

Expand Down
4 changes: 2 additions & 2 deletions XCreds/AboutWindow.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22690"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down
12 changes: 6 additions & 6 deletions XCreds/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22690"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand Down Expand Up @@ -328,14 +328,14 @@
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Speech" id="3rS-ZA-NoH">
<items>
<menuItem title="Start Speaking" id="Ynk-f8-cLZ">
<modifierMask key="keyEquivalentModifierMask"/>
<menuItem title="Start Speaking" keyEquivalent="s" id="Ynk-f8-cLZ">
<modifierMask key="keyEquivalentModifierMask" control="YES" option="YES" command="YES"/>
<connections>
<action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/>
</connections>
</menuItem>
<menuItem title="Stop Speaking" id="Oyz-dy-DGm">
<modifierMask key="keyEquivalentModifierMask"/>
<menuItem title="Stop Speaking" keyEquivalent="s" id="Oyz-dy-DGm">
<modifierMask key="keyEquivalentModifierMask" shift="YES" control="YES" option="YES" command="YES"/>
<connections>
<action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/>
</connections>
Expand Down
6 changes: 3 additions & 3 deletions XCreds/DesktopLoginWindowController.xib
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
<plugIn identifier="com.apple.WebKit2IBPlugin" version="22505"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22690"/>
<plugIn identifier="com.apple.WebKit2IBPlugin" version="22690"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down
4 changes: 2 additions & 2 deletions XCreds/PreferencesWindow.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22690"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down
2 changes: 1 addition & 1 deletion XCreds/ScheduleManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class ScheduleManager:TokenManagerFeedbackDelegate, NoMADUserSessionDelegate {
}

func NoMADAuthenticationFailed(error: NoMADSessionError, description: String) {
TCSLogErrorWithMark("NoMADAuthenticationFailed:\(description)")
TCSLogErrorWithMark("AuthenticationFailed:\(description)")
feedbackDelegate?.kerberosTicketCheckFailed(error)
}

Expand Down
25 changes: 22 additions & 3 deletions XCreds/TokenManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,34 @@ extension TokenManager {
func tokenResponse(tokens: OIDCLite.TokenResponse) {

TCSLogWithMark("======== tokenResponse =========")

RunLoop.main.perform {
let googleAuth = DefaultsOverride.standardOverride.bool(forKey: PrefKeys.shouldSetGoogleAccessTypeToOffline.rawValue)


let xcredCreds = Creds(password: nil, tokens: tokens)
if xcredCreds.hasAccessAndRefresh(){

if xcredCreds.hasAccessAndRefresh() {
TCSLogWithMark("Found access and refresh token")

}
if googleAuth {
TCSLogWithMark("Found google auth")

}
if xcredCreds.hasAccess() {
TCSLogWithMark("found access token")

}
if googleAuth && xcredCreds.hasAccess() {
TCSLogWithMark("Found google auth and access token")

}

if xcredCreds.hasAccessAndRefresh() || (googleAuth && xcredCreds.hasAccess()) {
self.feedbackDelegate?.credentialsUpdated(xcredCreds)
}
else {
self.feedbackDelegate?.tokenError("error gettings tokens")
self.feedbackDelegate?.tokenError("error gettings tokens: jsonDict:\(String(describing: tokens.jsonDict?.debugDescription))")
}

}
Expand Down
2 changes: 1 addition & 1 deletion XCredsLoginPlugIn/LoginWindow/SignInWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ extension SignInViewController: NoMADUserSessionDelegate {
func NoMADAuthenticationFailed(error: NoMADSessionError, description: String) {
updateCredentialsFeedbackDelegate?.kerberosTicketCheckFailed(error)

TCSLogWithMark("NoMADAuthenticationFailed: \(description)")
TCSLogWithMark("AuthenticationFailed: \(description)")
// alertTextField.isHidden=false
// alertTextField.stringValue = description
// if passChanged {
Expand Down
26 changes: 14 additions & 12 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,7 @@
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/Carthage/Build/Mac\"";
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.2;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
STRIP_INSTALLED_PRODUCT = NO;
Expand All @@ -1426,6 +1427,7 @@
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/Carthage/Build/Mac\"";
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.2;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
STRIP_INSTALLED_PRODUCT = NO;
Expand All @@ -1440,7 +1442,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6375;
CURRENT_PROJECT_VERSION = 6408;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1459,7 +1461,7 @@
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.1;
MARKETING_VERSION = 4.2;
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.XCredsLoginPlugin;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -1477,7 +1479,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6375;
CURRENT_PROJECT_VERSION = 6408;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1496,7 +1498,7 @@
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.1;
MARKETING_VERSION = 4.2;
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.XCredsLoginPlugin;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1598,7 +1600,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6375;
CURRENT_PROJECT_VERSION = 6408;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1615,7 +1617,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.1;
MARKETING_VERSION = 4.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.twocanoes.XCreds-Login-Overlay";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -1635,7 +1637,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6375;
CURRENT_PROJECT_VERSION = 6408;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1652,7 +1654,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.1;
MARKETING_VERSION = 4.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.twocanoes.XCreds-Login-Overlay";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1785,7 +1787,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6375;
CURRENT_PROJECT_VERSION = 6408;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1808,7 +1810,7 @@
"$(SDKROOT)/usr/lib/system",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.1;
MARKETING_VERSION = 4.2;
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.xcreds;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_INSTALLED_PRODUCT = NO;
Expand All @@ -1827,7 +1829,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6375;
CURRENT_PROJECT_VERSION = 6408;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1850,7 +1852,7 @@
"$(SDKROOT)/usr/lib/system",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.1;
MARKETING_VERSION = 4.2;
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.xcreds;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_INSTALLED_PRODUCT = NO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/apple/swift-argument-parser.git",
"state": {
"branch": null,
"revision": "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a",
"version": "1.2.2"
"revision": "46989693916f56d1186bd59ac15124caef896560",
"version": "1.3.1"
}
}
]
Expand Down
Binary file not shown.
Loading

0 comments on commit e2daed1

Please sign in to comment.