14
14
*/
15
15
16
16
#import < Foundation/Foundation.h>
17
+ #import " AWSServiceEnum.h"
18
+
19
+ FOUNDATION_EXPORT NSString *const AWSCognitoIdentityIdChangedNotification;
20
+ FOUNDATION_EXPORT NSString *const AWSCognitoNotificationPreviousId;
21
+ FOUNDATION_EXPORT NSString *const AWSCognitoNotificationNewId;
22
+
23
+ FOUNDATION_EXPORT NSString *const AWSCognitoCredentialsProviderErrorDomain;
24
+ typedef NS_ENUM (NSInteger , AWSCognitoCredentialsProviderErrorType) {
25
+ AWSCognitoCredentialsProviderErrorUnknown
26
+ };
27
+
28
+ typedef NS_ENUM (NSInteger , AWSCognitoLoginProviderKey) {
29
+ AWSCognitoLoginProviderKeyUnknown,
30
+ AWSCognitoLoginProviderKeyFacebook,
31
+ AWSCognitoLoginProviderKeyGoogle,
32
+ AWSCognitoLoginProviderKeyLoginWithAmazon,
33
+ };
17
34
18
35
@class BFTask;
19
36
20
37
@protocol AWSCredentialsProvider <NSObject >
21
38
22
39
@optional
23
- @property (nonatomic , readonly ) NSString *accessKey;
24
- @property (nonatomic , readonly ) NSString *secretKey;
25
- @property (nonatomic , readonly ) NSString *sessionKey;
40
+ @property (nonatomic , strong , readonly ) NSString *accessKey;
41
+ @property (nonatomic , strong , readonly ) NSString *secretKey;
42
+ @property (nonatomic , strong , readonly ) NSString *sessionKey;
43
+ @property (nonatomic , strong , readonly ) NSDate *expiration;
26
44
27
45
- (BFTask *)refresh ;
28
46
29
47
@end
30
48
31
49
@interface AWSStaticCredentialsProvider : NSObject <AWSCredentialsProvider>
32
50
51
+ @property (nonatomic , readonly ) NSString *accessKey;
52
+ @property (nonatomic , readonly ) NSString *secretKey;
53
+
33
54
+ (instancetype )credentialsWithAccessKey : (NSString *)accessKey
34
55
secretKey : (NSString *)secretKey ;
35
56
+ (instancetype )credentialsWithCredentialsFilename : (NSString *)credentialsFilename ;
45
66
46
67
@interface AWSWebIdentityCredentialsProvider : NSObject <AWSCredentialsProvider>
47
68
69
+ @property (nonatomic , strong , readonly ) NSString *accessKey;
70
+ @property (nonatomic , strong , readonly ) NSString *secretKey;
71
+ @property (nonatomic , strong , readonly ) NSString *sessionKey;
72
+ @property (nonatomic , strong , readonly ) NSDate *expiration;
73
+
48
74
@property (nonatomic , strong ) NSString *webIdentityToken;
49
75
@property (nonatomic , strong ) NSString *roleArn;
50
76
@property (nonatomic , strong ) NSString *provider;
51
77
52
- @property (nonatomic , strong , readonly ) NSError *error;
78
+ + (instancetype )credentialsWithRegionType : (AWSRegionType)regionType
79
+ provider : (NSString *)provider
80
+ webIdentityToken : (NSString *)webIdentityToken
81
+ roleArn : (NSString *)roleArn ;
53
82
54
- + (instancetype )credentialsWithProvider : (NSString *)provider
55
- webIdentityToken : (NSString *)webIdentityToken
56
- roleArn : (NSString *)roleArn ;
57
-
58
- - (instancetype )initWithProvider : (NSString *)provider
59
- webIdentityToken : (NSString *)webIdentityToken
60
- roleArn : (NSString *)roleArn ;
83
+ - (instancetype )initWithRegionType : (AWSRegionType)regionType
84
+ provider : (NSString *)provider
85
+ webIdentityToken : (NSString *)webIdentityToken
86
+ roleArn : (NSString *)roleArn ;
61
87
62
88
- (BFTask *)refresh ;
63
89
64
90
@end
91
+
92
+
93
+ @interface AWSCognitoCredentialsProvider : NSObject <AWSCredentialsProvider>
94
+
95
+ @property (nonatomic , strong , readonly ) NSString *accessKey;
96
+ @property (nonatomic , strong , readonly ) NSString *secretKey;
97
+ @property (nonatomic , strong , readonly ) NSString *sessionKey;
98
+ @property (nonatomic , strong , readonly ) NSDate *expiration;
99
+
100
+ @property (nonatomic , strong , readonly ) NSString *identityId;
101
+ @property (nonatomic , strong , readonly ) NSString *identityPoolId;
102
+
103
+ @property (nonatomic , strong ) NSDictionary *logins;
104
+
105
+ + (instancetype )credentialsWithRegionType : (AWSRegionType)regionType
106
+ accountId : (NSString *)accountId
107
+ identityPoolId : (NSString *)identityPoolId
108
+ unauthRoleArn : (NSString *)unauthRoleArn
109
+ authRoleArn : (NSString *)authRoleArn ;
110
+
111
+ + (instancetype )credentialsWithRegionType : (AWSRegionType)regionType
112
+ accountId : (NSString *)accountId
113
+ identityPoolId : (NSString *)identityPoolId
114
+ unauthRoleArn : (NSString *)unauthRoleArn
115
+ authRoleArn : (NSString *)authRoleArn
116
+ logins : (NSDictionary *)logins ;
117
+
118
+ + (instancetype )credentialsWithRegionType : (AWSRegionType)regionType
119
+ identityId : (NSString *)identityId
120
+ accountId : (NSString *)accountId
121
+ identityPoolId : (NSString *)identityPoolId
122
+ unauthRoleArn : (NSString *)unauthRoleArn
123
+ authRoleArn : (NSString *)authRoleArn
124
+ logins : (NSDictionary *)logins ;
125
+
126
+ - (instancetype )initWithRegionType : (AWSRegionType)regionType
127
+ identityId : (NSString *)identityId
128
+ accountId : (NSString *)accountId
129
+ identityPoolId : (NSString *)identityPoolId
130
+ unauthRoleArn : (NSString *)unauthRoleArn
131
+ authRoleArn : (NSString *)authRoleArn
132
+ logins : (NSDictionary *)logins ;
133
+
134
+ /* *
135
+ * Refreshes the locally stored credentials. The SDK automatically calls this method when necessary, and you do not need to call this method manually.
136
+ *
137
+ * @return <#return value description#>
138
+ */
139
+ - (BFTask *)refresh ;
140
+
141
+ - (BFTask *)getIdentityId ;
142
+
143
+ - (void )clearKeychain ;
144
+
145
+ @end
0 commit comments