Fix macOS demo not connecting
Missing keychain sharing capabilities.
This commit is contained in:
parent
92fd620771
commit
d977c3317c
|
@ -143,24 +143,24 @@ class ViewController: UIViewController, URLSessionDataDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func testFetchRef() {
|
private func testFetchRef() {
|
||||||
// let keychain = Keychain(group: ViewController.APP_GROUP)
|
let keychain = Keychain(group: appGroup)
|
||||||
// let username = "foo"
|
let username = "foo"
|
||||||
// let password = "bar"
|
let password = "bar"
|
||||||
//
|
|
||||||
// guard let _ = try? keychain.set(password: password, for: username) else {
|
guard let _ = try? keychain.set(password: password, for: username, context: tunnelIdentifier) else {
|
||||||
// print("Couldn't set password")
|
print("Couldn't set password")
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// guard let passwordReference = try? keychain.passwordReference(for: username) else {
|
guard let passwordReference = try? keychain.passwordReference(for: username, context: tunnelIdentifier) else {
|
||||||
// print("Couldn't get password reference")
|
print("Couldn't get password reference")
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// guard let fetchedPassword = try? Keychain.password(for: username, reference: passwordReference) else {
|
guard let fetchedPassword = try? keychain.password(for: username, reference: passwordReference, context: tunnelIdentifier) else {
|
||||||
// print("Couldn't fetch password")
|
print("Couldn't fetch password")
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// print("\(username) -> \(password)")
|
print("\(username) -> \(password)")
|
||||||
// print("\(username) -> \(fetchedPassword)")
|
print("\(username) -> \(fetchedPassword)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,5 +14,9 @@
|
||||||
</array>
|
</array>
|
||||||
<key>com.apple.security.network.client</key>
|
<key>com.apple.security.network.client</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>keychain-access-groups</key>
|
||||||
|
<array>
|
||||||
|
<string>$(AppIdentifierPrefix)group.com.algoritmico.TunnelKit.Demo</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -14,5 +14,9 @@
|
||||||
</array>
|
</array>
|
||||||
<key>com.apple.security.network.client</key>
|
<key>com.apple.security.network.client</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>keychain-access-groups</key>
|
||||||
|
<array>
|
||||||
|
<string>$(AppIdentifierPrefix)group.com.algoritmico.TunnelKit.Demo</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -128,25 +128,25 @@ class ViewController: NSViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func testFetchRef() {
|
private func testFetchRef() {
|
||||||
// let keychain = Keychain(group: ViewController.APP_GROUP)
|
let keychain = Keychain(group: appGroup)
|
||||||
// let username = "foo"
|
let username = "foo"
|
||||||
// let password = "bar"
|
let password = "bar"
|
||||||
//
|
|
||||||
// guard let _ = try? keychain.set(password: password, for: username) else {
|
guard let _ = try? keychain.set(password: password, for: username, context: tunnelIdentifier) else {
|
||||||
// print("Couldn't set password")
|
print("Couldn't set password")
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// guard let passwordReference = try? keychain.passwordReference(for: username) else {
|
guard let passwordReference = try? keychain.passwordReference(for: username, context: tunnelIdentifier) else {
|
||||||
// print("Couldn't get password reference")
|
print("Couldn't get password reference")
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// guard let fetchedPassword = try? Keychain.password(for: username, reference: passwordReference) else {
|
guard let fetchedPassword = try? keychain.password(for: username, reference: passwordReference, context: tunnelIdentifier) else {
|
||||||
// print("Couldn't fetch password")
|
print("Couldn't fetch password")
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// print("\(username) -> \(password)")
|
print("\(username) -> \(password)")
|
||||||
// print("\(username) -> \(fetchedPassword)")
|
print("\(username) -> \(fetchedPassword)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue