Skip to content

Commit

Permalink
shouldPreferLocalLoginInsteadOfCloudLogin
Browse files Browse the repository at this point in the history
Preference to default XCreds to the 'local' login option, even if cloud config is present.
  • Loading branch information
jamesez committed Aug 7, 2023
1 parent 63f4ca5 commit 79e798a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
14 changes: 14 additions & 0 deletions Profile Manifest/com.twocanoes.xcreds.plist
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,20 @@ Note that Google does not support the offline_access scope so instead use the pr
<key>pfm_type</key>
<string>boolean</string>
</dict>
<dict>
<key>pfm_default</key>
<false/>
<key>pfm_description</key>
<string>Favor using XCreds' local login screen over the cloud login UI.</string>
<key>pfm_documentation_url</key>
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#shouldpreferlocallogininsteadofcloudlogin</string>
<key>pfm_name</key>
<string>shouldPreferLocalLoginInsteadOfCloudLogin</string>
<key>pfm_title</key>
<string>Prefer Local Login over Cloud Login</string>
<key>pfm_type</key>
<string>boolean</string>
</dict>
<dict>
<key>pfm_default</key>
<string>0</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="xcreds local password",discoveryURL, redirectURI, scopes, accessToken, idToken, refreshToken, tokenEndpoint, expirationDate, invalidToken, refreshRateHours,refreshRateMinutes, 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="xcreds local password",discoveryURL, redirectURI, scopes, accessToken, idToken, refreshToken, tokenEndpoint, expirationDate, invalidToken, refreshRateHours,refreshRateMinutes, showDebug, verifyPassword, shouldShowQuitMenu, shouldShowPreferencesOnStart, shouldSetGoogleAccessTypeToOffline, passwordChangeURL, shouldShowAboutMenu, username, idpHostName, passwordElementID, shouldFindPasswordElement, shouldShowVersionInfo, shouldShowSupportStatus,shouldShowConfigureWifiButton,shouldShowMacLoginButton, loginWindowBackgroundImageURL, shouldShowCloudLoginByDefault, shouldPreferLocalLoginInsteadOfCloudLogin, idpHostNames,autoRefreshLoginTimer, loginWindowWidth, loginWindowHeight, shouldShowRefreshBanner, shouldSwitchToLoginWindowWhenLocked,accounts = "Accounts",
windowSignIn = "WindowSignIn", settingsOverrideScriptPath, localAdminUserName, localAdminPassword, usernamePlaceholder, passwordPlaceholder, shouldShowLocalOnlyCheckbox, shouldShowTokenUpdateStatus
case actionItemOnly = "ActionItemOnly"
case aDDomain = "ADDomain"
Expand Down
2 changes: 2 additions & 0 deletions XCreds/defaults.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
<false/>
<key>shouldShowCloudLoginByDefault</key>
<true/>
<key>shouldPreferLocalLoginInsteadOfCloudLogin</key>
<false/>
<key>shouldShowTokenUpdateStatus</key>
<true/>
<key>autoRefreshLoginTimer</key>
Expand Down
6 changes: 3 additions & 3 deletions XCredsLoginPlugIn/Mechanisms/web.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ import Cocoa
return
}
let discoveryURL=DefaultsOverride.standardOverride.value(forKey: PrefKeys.discoveryURL.rawValue)
let preferLocalLogin = DefaultsOverride.standardOverride.bool(forKey: PrefKeys.shouldPreferLocalLoginInsteadOfCloudLogin.rawValue)


if let _ = discoveryURL {
if preferLocalLogin == false,
let _ = discoveryURL {
showLoginWindowType(loginWindowType: .cloud)

}
else {
showLoginWindowType(loginWindowType: .usernamePassword)
Expand Down

0 comments on commit 79e798a

Please sign in to comment.