Latest 0.2.0
Homepage https://github.com/MrAlek/SharedWebCredentials
License MIT
Platforms ios 8.0, requires ARC
Frameworks Security
Authors

Version
License
Platform

The Shared Web Credentials API is used to store credentials
in the iCloud keychain to be shared among and between native iOS
apps and web apps on Safari for iOS and MacOS.

This is a Swift wrapper for that Core Foundation API.

SharedWebCredentials

References

Apple Developer Documentation: Shared Web Credentials

WWDC Session 506: Your App, Your Website, and Safari

Example usage


// Fetch credentials
SharedWebCredentials.request(fqdn: "webapp.example.com") { credential, error in
    if let credential = credential {
        print("Account: (credential.account), Password: (credential.password)")
    }
}

// Save new credential
let credential = Credential(account: "[email protected]", password: "p4ssw0rd")
SharedWebCredentials.save(credential: credential, fqdn: "webapp.example.com") { error in
    print("Saved!")
}

// Delete credential after password reset
SharedWebCredentials.delete(account: "[email protected]", fqdn: "webapp.example.com") { error in
    print("Deleted!")
}

Requirements & Swift versions

  • Version 0.1.x is built for Swift 2.3
  • Version 0.2.x and above is built for Swift 3.0

Installation

Cocoapods

To integrate SharedWebCredentials into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
platform :ios, '8.0'

pod 'SharedWebCredentials', '~> 0.1'

Then, run the following command:

$ pod install

Carthage

To integrate SharedWebCredentials into your Xcode project using Carthage, specify it in your Cartfile:

github "MrAlek/SharedWebCredentials" >= 0.1

License

SharedWebCredentials is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SharedWebCredentials",
    "version": "0.2.0",
    "summary": "A Swift wrapper for the Shared Web Credentials API",
    "description": "The Shared Web Credentials API is used to store credentialsnin the iCloud keychain to be shared among and between native iOSnapps and web apps on Safari for iOS and MacOS.",
    "homepage": "https://github.com/MrAlek/SharedWebCredentials",
    "license": "MIT",
    "authors": {
        "Alek Au030astrou0308m": "[email protected]"
    },
    "source": {
        "git": "https://github.com/MrAlek/SharedWebCredentials.git",
        "tag": "0.2.0"
    },
    "social_media_url": "https://twitter.com/MisterAlek",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Source/*.swift",
    "frameworks": "Security"
}

Pin It on Pinterest

Share This