ArcGIS Runtime SDK for iOS: AGSCredential.h Source File
ArcGIS Runtime SDK for iOS  100.11
AGSCredential.h
Go to the documentation of this file.
1 /*
2  COPYRIGHT 2021 ESRI
3 
4  All rights reserved under the copyright laws of the United States
5  and applicable international laws, treaties, and conventions.
6 
7  This material is licensed for use under the Esri Master License
8  Agreement (MLA), and is bound by the terms of that agreement.
9  You may redistribute and use this code without modification,
10  provided you adhere to the terms of the MLA and include this
11  copyright notice.
12 
13  See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
14 
15  For additional information, contact:
16  Environmental Systems Research Institute, Inc.
17  Attn: Contracts and Legal Services Department
18  380 New York Street
19  Redlands, California, 92373
20  USA
21 
22  email: contracts@esri.com
23  */
24  //Required for Globals API doc
26 
27 #import <Foundation/Foundation.h>
28 #import <Security/Security.h>
29 
30 
31 
37 typedef {
38  AGSCredentialErrorTypeNone = 0,
39  AGSCredentialErrorTypeInvalidCredentials ,
40  AGSCredentialErrorTypeSSLRequired ,
41  AGSCredentialErrorTypeUnknown
42 };
43 
52 @interface AGSCredential : NSObject <NSCopying, NSCoding>
53 
54 #pragma mark -
55 #pragma mark properties
56 
60 @property (nullable, nonatomic, copy) NSString *username;
61 
65 @property (nullable, nonatomic, copy) NSString *password;
66 
70 @property (nullable, nonatomic, strong) NSURL *tokenUrl;
71 
75 @property (nullable, nonatomic, copy, readonly) NSString *referer;
76 
77 
81 @property (nullable, nonatomic, copy) NSString *token;
82 
86 @property (nullable, nonatomic, assign) SecIdentityRef identity;
87 
91 @property (nonatomic, assign, readwrite, getter=isCachingEnabled) BOOL cachingEnabled;
92 
96 @property (nullable, nonatomic, copy) NSData *identityCertificateData;
97 
101 @property (nullable, nonatomic, copy) NSString *identityCertificatePassword;
102 
103 #pragma mark -
104 #pragma mark initializers
105 
112 - (instancetype)initWithUser:(NSString*)username password:(NSString*)password;
113 
119 - (instancetype)initWithIdentityRef:(SecIdentityRef)identityRef;
120 
127 - (instancetype)initWithToken:(NSString*)token referer:(nullable NSString*)referer;
128 
135 - (nullable instancetype)initWithIdentityCertificateData:(NSData *)data password:(NSString *)password;
136 
143 + (instancetype)credentialWithUser:(NSString*)username password:(NSString*)password;
144 
145 #pragma mark -
146 #pragma mark methods
147 
160 + (nullable NSArray<id>*)identitiesForProtectionSpace:(nullable NSURLProtectionSpace*)protectionSpace ;
161 
177 + (nullable SecIdentityRef)importCertificateData:(NSData*)data password:(NSString*)password overwrite:(BOOL)overwrite error:(NSError**)error ;
178 
189 + (OSStatus)removeIdentityFromKeychain:(SecIdentityRef)identityRef ;
190 
195 - (nullable NSString*)authenticatingHost;
196 
197 @end
198 
199 
Represents an credential to access a secured resource.
Definition: AGSCredential.h:52
NSString * identityCertificatePassword
Definition: AGSCredential.h:101
NSURL * tokenUrl
Definition: AGSCredential.h:70
NSString * username
Definition: AGSCredential.h:60
SecIdentityRef identity
Definition: AGSCredential.h:86
NSString * referer
Definition: AGSCredential.h:75
NSString * token
Definition: AGSCredential.h:81
BOOL cachingEnabled
Definition: AGSCredential.h:91
NSString * password
Definition: AGSCredential.h:65
nullable NSString * authenticatingHost()
NSData * identityCertificateData
Definition: AGSCredential.h:96