ios - Storing access token and refresh token in KeyChain -


i know how store access token, refresh tokens , expirations in ios keychain.

all examples have seen seem store 1 key-value combination. how store multiple key values 1 keychain identifier?

if there better way store above, please let me know.

you first want build nsdictionary key/values want. next, use lockbox store nsdictionary keychain, using provided setdictionary:forkey: interface.

update: change values stored in dictionary, have pass nsmutabledictionary (that's common way of doing):

nsmutabledictionary *mutabledict = [[lockbox dictionaryforkey:@"yourrefreshtokendictionarykey"] mutablecopy]; mutabledict[@"access_token"] = @"newaccesstoken"; [lockbox setdictionary:mutabledict forkey:@"yourrefreshtokendictionarykey"];  

fyi, nsmutabledictionary subclass of nsdictionary, it's safe save directly keychain!


Comments

Popular posts from this blog

java - Incorrect order of records in M-M relationship in hibernate -

command line - Use qwinsta in PowerShell ISE -

php - I want to create a website for polls/survey like this http://www.poll-maker.com/ -