ArcGIS Runtime SDK for iOS
100.15
|
Represents an authentication challenge when accessing secured resources.
Instances of this class represent an authentication challenge that was raised because a security error was encountered while trying to access a secured remote resource. You can use AGSAuthenticationManager::setChallengeHandler:
in order to register a block for handling all authentication challenges in your app. This block can help centralize your authentication related logic.
To satisfy the challenge, you need to do one of the following -
continueWithCredential: (AGSAuthenticationChallenge)
with a valid credential. The remoteResource
that issued the challenge will try to connect to the resource with those credentials. cancel (AGSAuthenticationChallenge)
to cancel the challenge. The remoteResource
that issued the challenge will fail to connect to the resource. trustHostAndContinue (AGSAuthenticationChallenge)
if the challenge was due to an untrusted server certificate and if you choose to trust the serverInstance Methods | |
(void) | - cancel |
(void) | - continueWithCredential: |
(void) | - continueWithDefaultHandling |
(BOOL) | - isRemoteResourceFederatedWithPortalURL: |
(void) | - trustHostAndContinue |
Properties | |
NSString * | authenticatingHost |
NSError * | error |
NSUInteger | failureCount |
NSURL * | portalURL |
AGSCredential * | proposedCredential |
NSURLProtectionSpace * | protectionSpace |
id< AGSRemoteResource > | remoteResource |
NSURLRequest * | request |
AGSAuthenticationChallengeType | type |
- (void) cancel |
Cancels performing the operation that led to the authentication challenge, resource will fail to load.
- (void) continueWithCredential: | (nullable AGSCredential *) | credential |
Attempts to continue loading the remoteResource
with the provided credential. Continuing with nil will cause the resource to fail to load.
proposedCredential
- (void) continueWithDefaultHandling |
A default handler will be used which displays UI containing information about the challenge and presents appropriate options to the user.
AGSAuthenticationChallengeTypeUsernamePassword
, requests a username and password from the user.AGSAuthenticationChallengeTypeOAuth
, displays the OAuth web page for the user to sign in.AGSAuthenticationChallengeTypeClientCertificate
, allows user to choose a certificate if certificate(s) are available in the keychain, otherwise, browse for the certificate using UIDocumentPickerViewController
.AGSAuthenticationChallengeTypeUntrustedHost
, allows user to either trust the host or cancel the challenge. - (BOOL) isRemoteResourceFederatedWithPortalURL: | (NSURL *) | portalURL |
Returns a BOOL indicating whether the remoteResource
is federated with speficied portal url.
- (void) trustHostAndContinue |
Adds the authenticatingHost
to a list of trusted hosts and repeats the web request.
type
to make sure challenge is for an untrusted server certificate.
|
readnonatomiccopy |
The host server of the remoteResource
. This is useful to display to a user when prompting them for credentials when a resource fails to load.
|
readnonatomicstrong |
The underlying security error that led to this authentication challenge.
|
readnonatomicassign |
The number of times this particular challenge has failed.
|
readnonatomicstrong |
The portal URL will be avilable when the remote resource is a portal or any federated resource.
|
readnonatomicstrong |
An empty credential that has been pre-configured with the authentication scheme being used by the remoteResource
. All you need to do is specify is the identity through a username/password, or token, or certificate, and then call continueWithCredential:
|
readnonatomicstrong |
The security realm of the web request.
|
readnonatomicweak |
The secured resource that needs authentication.
|
readnonatomiccopy |
The web request used to access the remoteResource
that led to this authentication challenge.
|
readnonatomicassign |
Type of authentication challenge. This is useful for displaying user interface to user for credentials when a resource fails to load.