Skip to content

Instantly share code, notes, and snippets.

@billburgess
Created May 13, 2012 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billburgess/2688294 to your computer and use it in GitHub Desktop.
Save billburgess/2688294 to your computer and use it in GitHub Desktop.
Saving credentials to iOS Keychain
// store user/pass to the keychain
KeychainItemWrapper *wrapper = [[KeychainItemWrapper alloc] initWithIdentifier:@"SomeCustomIdentifier" accessGroup:nil];
[wrapper setObject:APP_NAME forKey:(__bridge id)kSecAttrService];
[wrapper setObject:(__bridge id)kSecAttrAccessibleAlways forKey:(__bridge id)kSecAttrAccessible];
[wrapper setObject:email forKey:(__bridge id)kSecAttrAccount];
[wrapper setObject:token forKey:(__bridge id)kSecValueData];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment