All Projects → auth0 → Simplekeychain

auth0 / Simplekeychain

Licence: mit
A Keychain helper for iOS to make it very simple to store/obtain values from iOS Keychain

Projects that are alternatives of or similar to Simplekeychain

vault-token-helper
@hashicorp Vault Token Helper for macOS, Linux and Windows with support for secure token storage and multiple Vault servers 🔐
Stars: ✭ 74 (-79.44%)
Mutual labels:  keychain
KeychainWrapper
A lightweight, pure-Swift library for the iOS keychain.
Stars: ✭ 51 (-85.83%)
Mutual labels:  keychain
Xyuuid
iOS14 UUID KeyChain DeviceInfo IDFA UDID
Stars: ✭ 301 (-16.39%)
Mutual labels:  keychain
alks-cli
CLI for working with the ALKS service.
Stars: ✭ 40 (-88.89%)
Mutual labels:  keychain
swift-standard-clients
Client declarations and live implementations for standard iOS managers
Stars: ✭ 28 (-92.22%)
Mutual labels:  keychain
pinentry-touchid
Custom GPG pinentry program for macOS that allows using Touch ID for fetching the password from the macOS keychain.
Stars: ✭ 152 (-57.78%)
Mutual labels:  keychain
GenericLocalPersistence
GenericLocalPersistence is a clean and easy-to-use code that is useful for integrating local storage like UserDefaults, PList, Keychain.
Stars: ✭ 17 (-95.28%)
Mutual labels:  keychain
Chezmoi
Manage your dotfiles across multiple diverse machines, securely.
Stars: ✭ 5,590 (+1452.78%)
Mutual labels:  keychain
lockd
Generate strong passwords and save them in Keychain. Made with SwiftUI
Stars: ✭ 38 (-89.44%)
Mutual labels:  keychain
Csv2keychain
Small tool for adding exported credentials from Chrome to macOS keychain
Stars: ✭ 295 (-18.06%)
Mutual labels:  keychain
MSession
A simple and sophisticated session and authentication solution written in Swift
Stars: ✭ 26 (-92.78%)
Mutual labels:  keychain
LAPSforMac
Local Administrator Password Solution for Mac
Stars: ✭ 29 (-91.94%)
Mutual labels:  keychain
Csvkeychain
Import/export between Apple Keychain.app and plain CSV file.
Stars: ✭ 281 (-21.94%)
Mutual labels:  keychain
fortify
Fortify enables web applications to use smart cards, local certificate stores and do certificate enrollment. This is the desktop application repository.
Stars: ✭ 88 (-75.56%)
Mutual labels:  keychain
Gokey
A simple vaultless password manager in Go
Stars: ✭ 305 (-15.28%)
Mutual labels:  keychain
vault
Is a plugin for project management system Redmine. Allows you to store various passwords/keys in one place for the project.
Stars: ✭ 44 (-87.78%)
Mutual labels:  keychain
WaxSealCore
Simple, expressive yet comprehensive keychain wrapper in Objective-C.
Stars: ✭ 33 (-90.83%)
Mutual labels:  keychain
Macosvpn
🔧 Create macOS VPNs programmatically (L2TP & Cisco)
Stars: ✭ 348 (-3.33%)
Mutual labels:  keychain
Go Keychain
Golang keychain package for iOS and macOS
Stars: ✭ 323 (-10.28%)
Mutual labels:  keychain
Uickeychainstore
UICKeyChainStore is a simple wrapper for Keychain on iOS, watchOS, tvOS and macOS. Makes using Keychain APIs as easy as NSUserDefaults.
Stars: ✭ 3,029 (+741.39%)
Mutual labels:  keychain

SimpleKeychain

CircleCI Coverage Status Version License Platform

A wrapper to make it really easy to deal with iOS Keychain and store your user's credentials securely.

Key Features

  • Simple interface to store user's credentials (e.g. JWT) in the Keychain.
  • Store credentials under an Access Group to enable Keychain Sharing.
  • TouchID/FaceID integration with a reusable LAContext instance.

Table of Contents

Requirements

  • iOS 9.0+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 11.4+ / 12.x
  • Swift 4.x / 5.x

Installation

CocoaPods

If you are using Cocoapods, add this line to your Podfile:

pod "SimpleKeychain"

Then run pod install.

For more information on Cocoapods, check their official documentation.

Carthage

If you are using Carthage, add the following line to your Cartfile:

github "auth0/SimpleKeychain"

Then run carthage bootstrap.

For more information about Carthage usage, check their official documentation.

SPM

If you are using the Swift Package Manager, open the following menu item in Xcode:

File > Swift Packages > Add Package Dependency...

In the Choose Package Repository prompt add this url:

https://github.com/auth0/SimpleKeychain.git

Then, press Next and complete the remaining steps.

For more information on SPM, check its official documentation.

Usage

Save a JWT token or password

let jwt = // user's JWT token obtained after login
A0SimpleKeychain().setString(jwt, forKey: "auth0-user-jwt")

Obtain a JWT token or password

let jwt = A0SimpleKeychain().string(forKey: "auth0-user-jwt")

Share a JWT Token with other apps using iOS Access Group

let jwt = // user's JWT token obtained after login
let keychain = A0SimpleKeychain(service: "Auth0", accessGroup: "ABCDEFGH.com.mydomain.myaccessgroup")
keychain.setString(jwt, forKey: "auth0-user-jwt")

Store and retrieve a JWT token using TouchID/FaceID

Let's save the JWT first:

let jwt = // user's JWT token obtained after login
let keychain = A0SimpleKeychain()
keychain.useAccessControl = true
keychain.defaultAccessiblity = .whenPasscodeSetThisDeviceOnly
keychain.setTouchIDAuthenticationAllowableReuseDuration(5.0)
keychain.setString(jwt, forKey: "auth0-user-jwt")

If there is an existent value under the key auth0-user-jwt saved with AccessControl and A0SimpleKeychainItemAccessibleWhenPasscodeSetThisDeviceOnly, iOS will prompt the user to enter their passcode or fingerprint before updating the value.

Then let's obtain the value:

let message = NSLocalizedString("Please enter your passcode/fingerprint to login with awesome App!.", comment: "Prompt TouchID message")
let keychain = A0SimpleKeychain()
let jwt = keychain.string(forKey: "auth0-user-jwt", promptMessage: message)

Remove a JWT token or password

A0SimpleKeychain().deleteEntry(forKey: "auth0-user-jwt")

Contributing

Just clone the repo, run carthage bootstrap and you're ready to contribute!

What is Auth0?

Auth0 helps you to:

  • Add authentication with multiple sources, either social identity providers such as Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce (amongst others), or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS, or any SAML Identity Provider.
  • Add authentication through more traditional username/password databases.
  • Add support for linking different user accounts with the same user.
  • Support for generating signed JSON Web Tokens to call your APIs and flow the user identity securely.
  • Analytics of how, when, and where users are logging in.
  • Pull data from other sources and add it to the user profile through JavaScript rules.

Create a Free Auth0 Account

  1. Go to Auth0 and click Sign Up.
  2. Use Google, GitHub, or Microsoft Account to login.

Issue Reporting

If you have found a bug or to request a feature, please raise an issue. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].