-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
771 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// ManagedPreferences.swift | ||
// XCreds | ||
// | ||
// Created by Timothy Perfitt on 7/2/22. | ||
// | ||
|
||
import Foundation | ||
|
||
class ManagedPreferences { | ||
static let shared = ManagedPreferences() | ||
|
||
init() { | ||
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// | ||
// Use this file to import your target's public headers that you would like to expose to Swift. | ||
// | ||
|
||
#import "XCredsLoginPlugin.h" | ||
#import "TCSUnifiedLogger.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="20037" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="20037"/> | ||
<plugIn identifier="com.apple.WebKit2IBPlugin" version="20037"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<objects> | ||
<customObject id="-2" userLabel="File's Owner" customClass="WebViewController" customModule="XCredsLoginPlugin" customModuleProvider="target"> | ||
<connections> | ||
<outlet property="webView" destination="p1x-1L-05D" id="hJN-Xq-dh8"/> | ||
<outlet property="window" destination="KxT-zM-Vnn" id="v4i-bY-4eE"/> | ||
</connections> | ||
</customObject> | ||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> | ||
<customObject id="-3" userLabel="Application" customClass="NSObject"/> | ||
<window title="Sign In" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" titleVisibility="hidden" id="KxT-zM-Vnn" customClass="LoginWindow" customModule="XCredsLoginPlugin" customModuleProvider="target"> | ||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> | ||
<rect key="contentRect" x="453" y="250" width="628" height="613"/> | ||
<rect key="screenRect" x="0.0" y="0.0" width="1536" height="935"/> | ||
<view key="contentView" wantsLayer="YES" id="2LH-tE-efn"> | ||
<rect key="frame" x="0.0" y="0.0" width="628" height="613"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<subviews> | ||
<wkWebView wantsLayer="YES" allowsLinkPreview="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p1x-1L-05D"> | ||
<rect key="frame" x="0.0" y="0.0" width="628" height="613"/> | ||
<wkWebViewConfiguration key="configuration" allowsAirPlayForMediaPlayback="NO" suppressesIncrementalRendering="YES"> | ||
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/> | ||
<wkPreferences key="preferences" javaScriptCanOpenWindowsAutomatically="NO"/> | ||
</wkWebViewConfiguration> | ||
<connections> | ||
<outlet property="UIDelegate" destination="-2" id="Qhy-Dl-wsg"/> | ||
</connections> | ||
</wkWebView> | ||
</subviews> | ||
<constraints> | ||
<constraint firstAttribute="trailing" secondItem="p1x-1L-05D" secondAttribute="trailing" id="3Xb-lz-75r"/> | ||
<constraint firstItem="p1x-1L-05D" firstAttribute="leading" secondItem="2LH-tE-efn" secondAttribute="leading" id="ejy-F7-Axt"/> | ||
<constraint firstItem="p1x-1L-05D" firstAttribute="top" secondItem="2LH-tE-efn" secondAttribute="top" id="gmG-FO-hZc"/> | ||
<constraint firstAttribute="bottom" secondItem="p1x-1L-05D" secondAttribute="bottom" id="vCP-fw-q3U"/> | ||
</constraints> | ||
</view> | ||
<point key="canvasLocation" x="250" y="297.5"/> | ||
</window> | ||
</objects> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// WebView.swift | ||
// xCreds | ||
// | ||
// Created by Timothy Perfitt on 4/5/22. | ||
// | ||
|
||
import Foundation | ||
import Cocoa | ||
import WebKit | ||
import OIDCLite | ||
|
||
class LoginWebViewController: WebViewController { | ||
override func windowDidLoad() { | ||
super.windowDidLoad() | ||
setupLoginWindowAppearance() | ||
loadPage() | ||
} | ||
fileprivate func setupLoginWindowAppearance() { | ||
self.window?.level = .screenSaver | ||
self.window?.orderFrontRegardless() | ||
|
||
self.window?.backgroundColor = NSColor.black | ||
|
||
self.window?.titlebarAppearsTransparent = true | ||
|
||
self.window?.isMovable = false | ||
self.window?.canBecomeVisibleWithoutLogin = true | ||
|
||
let screenRect = NSScreen.screens[0].frame | ||
self.window?.setFrame(screenRect, display: true, animate: false) | ||
|
||
} | ||
|
||
|
||
@objc override var windowNibName: NSNib.Name { | ||
return NSNib.Name("LoginWebView") | ||
} | ||
|
||
|
||
|
||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// LoginWindow.swift | ||
// XCredsLoginPlugin | ||
// | ||
// Created by Timothy Perfitt on 7/2/22. | ||
// | ||
|
||
import Cocoa | ||
|
||
class LoginWindow: NSWindow { | ||
override var canBecomeKey: Bool { | ||
return true | ||
} | ||
|
||
} |
Oops, something went wrong.