ArcGIS Runtime SDK for iOS
100.15
|
Represents an credential to access a secured resource.
Instances of this class represent a credential object to access a secured ArcGIS resource. The resource could be secured using ArcGIS tokens or HTTP (basic or digest) authentication.
@define{AGSCredential.h, ArcGIS}
Instance Methods | |
(nullable NSString *) | - authenticatingHost |
(nullable instancetype) | - initWithIdentityCertificateData:password: |
(instancetype) | - initWithIdentityRef: |
(instancetype) | - initWithToken:referer: |
(instancetype) | - initWithUser:password: |
Class Methods | |
(instancetype) | + credentialWithUser:password: |
(nullable NSArray< id > *) | + identitiesForProtectionSpace: |
(nullable SecIdentityRef) | + importCertificateData:password:overwrite:error: |
(OSStatus) | + removeIdentityFromKeychain: |
Properties | |
BOOL | cachingEnabled |
SecIdentityRef | identity |
NSData * | identityCertificateData |
NSString * | identityCertificatePassword |
NSString * | password |
NSString * | referer |
NSString * | token |
NSURL * | tokenUrl |
NSString * | username |
- (nullable NSString*) authenticatingHost |
Returns the host (including port number) that a username/password will be sent to for authentication. This is useful to display to a user when prompting them for credentials when a resource fails to load.
+ (instancetype) credentialWithUser: | (NSString *) | username | |
password: | (NSString *) | password | |
Initialize an AGSCredential
object.
username | The username of user attempting to access secured resource. |
password | The password of user attempting to access secured resource. |
AGSCredential
. + (nullable NSArray<id>*) identitiesForProtectionSpace: | (nullable NSURLProtectionSpace *) | protectionSpace |
Returns an array of SecIdentityRef
objects that can be used to authenticate against the specified NSURLProtectionSpace
. Pass nil for the protectionSpace
to return all identities available to the application.
protectionSpace | The protection space in which to retrieve identities for. |
SecIdentityRef
objects that can be used for client certificate authentication. continueWithDefaultHandling (AGSAuthenticationChallenge)
to respond to the authentication challenge which allows the user to browse for the certificate on the device. Alternatively, you can choose to handle the challenge yourself and display custom UI for picking a certificate, in which case use the new init method initWithIdentityCertificateData:password:
to create the credential and respond to the challenge. + (nullable SecIdentityRef) importCertificateData: | (NSData *) | data | |
password: | (NSString *) | password | |
overwrite: | (BOOL) | overwrite | |
error: | (NSError **) | error | |
Imports the certificate data into the keychain for the running application. This certificate can be retrieved from any application that shares the same keychain access group.
data | The data representing the client certificate. |
password | The password to be used to access the certificate. |
overwrite | If YES , this method will delete an existing certificate that matches and then re-add the certificate represented by data. |
error | Returned if an error is encountered while importing the data. |
SecIdentityRef
object representing the imported data. continueWithDefaultHandling (AGSAuthenticationChallenge)
to respond to the authentication challenge which allows the user to browse for the certificate on the device. Alternatively, you can choose to handle the challenge yourself and display custom UI for picking a certificate, in which case use the new init method initWithIdentityCertificateData:password:
to create the credential and respond to the challenge. - (nullable instancetype) initWithIdentityCertificateData: | (NSData *) | data | |
password: | (NSString *) | password | |
Initialize an AGSCredential object with the certificate data and password.
data | The data representing the client certificate. |
password | The password to be used to access the certificate data. |
AGSCredential
or nil
if unable to create SecIdentityRef
from provided data and password. - (instancetype) initWithIdentityRef: | (SecIdentityRef) | identityRef |
Initialize an AGSCredential object with an SecIdentityRef
.
identityRef | The identity in which to initialize the credential object. |
AGSCredential
. - (instancetype) initWithToken: | (NSString *) | token | |
referer: | (nullable NSString *) | referer | |
Initialize an AGSCredential object with a long-lived token and referer. This token will be used to access the secured resource.
token | The long-lived token to initialize the credential object. |
referer | The referer to be sent along with token in the request. |
AGSCredential
. - (instancetype) initWithUser: | (NSString *) | username | |
password: | (NSString *) | password | |
Initialize an AGSCredential
object.
username | The username of user attempting to access secured resource. |
password | The password of user attempting to access secured resource. |
AGSCredential
. + (OSStatus) removeIdentityFromKeychain: | (SecIdentityRef) | identityRef |
Removes an identity and its certificates from the keychain.
identityRef | The identity to remove from the keychain. |
OSStatus
result code indicating success or failure. See SecBase.h for for possible values. continueWithDefaultHandling (AGSAuthenticationChallenge)
to respond to the authentication challenge which allows the user to browse for the certificate on the device. Alternatively, you can choose to handle the challenge yourself and display custom UI for picking a certificate, in which case use the new init method initWithIdentityCertificateData:password:
to create the credential and respond to the challenge.
|
readwritenonatomicassign |
Specifies whehter credential can be added to the credential cache. Default is YES.
|
readwritenonatomicassign |
The identity associated with this credential.
|
readwritenonatomiccopy |
The data representing the client certificate.
|
readwritenonatomiccopy |
The password to be used to access the identityCertificateData
.
|
readwritenonatomiccopy |
Password used to access secured resource or retrieve a token.
|
readnonatomiccopy |
A string representing the referer for which the long-lived token was generated.
|
readwritenonatomiccopy |
Generated by the server from a username/password combination.
|
readwritenonatomicstrong |
Url to the token service.
|
readwritenonatomiccopy |
Username used to access secured resource or retrieve a token.