ArcGIS Runtime SDK for iOS
100.15
|
A cache containing credentials to reuse.
Instances of this class represent a cache containing credentials. Objects that use the same cache could potentially reuse credentials if they need to access the same security realm and a credential for it already exists in the cache.
Instance Methods | |
(void) | - disableAutoSyncToKeychain |
(void) | - enableAutoSyncToKeychainWithIdentifier:accessGroup:acrossDevices: |
(void) | - enableAutoSyncToKeychainWithIdentifier:accessGroup:acrossDevices:accessible: |
(void) | - removeAllCredentials |
(void) | - removeAndRevokeAllCredentialsWithCompletion: |
(void) | - removeAndRevokeCredential:completion: |
Class Methods | |
(void) | + removeFromKeychainWithIdentifier:completion: |
Properties | |
BOOL | autoSyncToKeychain |
AGSKeychainItem * | keychainItem |
- (void) disableAutoSyncToKeychain |
Disables automatic syncing of credential cache to the keychain. If you want to remove entry from keychain then use removeFromKeychainWithIdentifier:completion:
.
- (void) enableAutoSyncToKeychainWithIdentifier: | (NSString *) | identifier | |
accessGroup: | (nullable NSString *) | accessGroup | |
acrossDevices: | (BOOL) | acrossDevices | |
Enables automatic syncing of credential cache to the keychain. An exception will be raised if identifier is nil or empty. If item is available in the keychain for the specified identifier then it will be fetched from the keychain and replace the contents of the current credential cache. If no item is found with the specified identifier, then current credential cache will be pushed to the keychain. Any changes to the credential cache after auto-syncing is enabled will be pushed to keychain automatically.
identifier | The keychain identifier. Must be unique. Cannot be nil. |
accessGroup | If you want the credential cache keychain item to be shared among multiple applications, the value of this key must be the name of a keychain access group to which all of the programs that will share this item belong. Otherwise, nil. |
acrossDevices | If you want to share the keychain item across devices using iCloud Keychain then set to YES. The iCloud Keychain must be enabled on device to make this work. |
- (void) enableAutoSyncToKeychainWithIdentifier: | (NSString *) | identifier | |
accessGroup: | (nullable NSString *) | accessGroup | |
acrossDevices: | (BOOL) | acrossDevices | |
accessible: | (AGSKeychainItemAccessible) | accessible | |
Enables automatic syncing of credential cache to the keychain. An exception will be raised if identifier is nil or empty. If item is available in the keychain for the specified identifier then it will be fetched from the keychain and replace the contents of the current credential cache. If no item is found with the specified identifier, then current credential cache will be pushed to the keychain. Any changes to the credential cache after auto-syncing is enabled will be pushed to keychain automatically.
identifier | The keychain identifier. Must be unique. Cannot be nil. |
accessGroup | If you want the credential cache keychain item to be shared among multiple applications, the value of this key must be the name of a keychain access group to which all of the programs that will share this item belong. Otherwise, nil. |
acrossDevices | If you want to share the keychain item across devices using iCloud Keychain then set to YES. The iCloud Keychain must be enabled on device to make this work. |
accessible | Indicates when a keychain item is accessible. If acrossDevices is YES, the valid options are only those which do not end with ThisDeviceOnly, as those cannot sync to another device. You cannot change this option after the first time you enable auto sync in your app. The keychain item will always be persisted with the option you first provided while enabling auto sync. To change this option, you first have to remove the existing keychain item using removeFromKeychainWithIdentifier:completion: . |
- (void) removeAllCredentials |
Removes all AGSCredential
objects from the cache.
- (void) removeAndRevokeAllCredentialsWithCompletion: | (nullable void(^)(NSDictionary< AGSCredential *, NSError * > *results)) | completion |
Removes all credentials from the cache and revokes tokens if appropriate. If any credential is used for OAuth authentication, a request is sent to revoke its OAuth token. All credentials are removed from the cache even if OAuth token revocation fails.
completion | The result of the operation. The result contains an NSDictionary that will be empty if no errors occurred. If it's not empty, each entry contains an AGSCredential for which OAuth token revocation failed and an error indicating why it failed. |
- (void) removeAndRevokeCredential: | (AGSCredential *) | credential | |
completion: | (nullable void(^)(NSError *__nullable error)) | completion | |
Removes the given credential from the credential cache and revokes its token if appropriate. If the credential is used for OAuth authentication, a request is sent to revoke its OAuth token. The credential is removed from the cache even if OAuth token revocation fails.
credential | The credential to be revoked if it's an OAuth token, and removed from the cache. |
completion | Completion handler with an error, if any. If the result indicates an error occurred, the error relates to the request to revoke the OAuth token. |
+ (void) removeFromKeychainWithIdentifier: | (NSString *) | identifier | |
completion: | (nullable void(^)(NSError *__nullable error)) | completion | |
Removes credential cache from keychain. If automatic syncing of credential cache is enabled for the same keychain identifier then any activity on credential cache will re-add the keychin item. If acrossDevices
was true while enabling automatic syncing then it will be honored and iCloud Keychain item will be removed as well.
|
readnonatomicassign |
Indicates whether to save credential cache to keychain or not.
|
readnonatomicstrong |
Instance of the keychain item if the credential cache is synced with keychain.