AWSCognitoIdentityUserPool
Objective-C
@interface AWSCognitoIdentityUserPool : NSObject <AWSIdentityProvider, AWSIdentityProviderManager>
@property (nonatomic, readonly) AWSServiceConfiguration *configuration;
@property (nonatomic, readonly) AWSCognitoIdentityUserPoolConfiguration *userPoolConfiguration;
@property (nonatomic, readonly) NSString *identityProviderName;
/**
Set this delegate to interactively prompt users for authentication challenges when necessary
*/
@property (nonatomic, strong) id <AWSCognitoIdentityInteractiveAuthenticationDelegate> delegate;
/**
* Fetches the Cognito User Pool instance configured in the `info.plist` under `CognitoUserPool`
*
* @return the default instance for Cognito User Pool
*/
+ (instancetype)defaultCognitoIdentityUserPool;
+ (void)registerCognitoIdentityUserPoolWithUserPoolConfiguration:(AWSCognitoIdentityUserPoolConfiguration *)userPoolConfiguration
forKey:(NSString *)key;
+ (void)registerCognitoIdentityUserPoolWithConfiguration:(nullable AWSServiceConfiguration *)configuration
userPoolConfiguration:(AWSCognitoIdentityUserPoolConfiguration *)userPoolConfiguration
forKey:(NSString *)key;
+ (nullable instancetype)CognitoIdentityUserPoolForKey:(NSString *)key;
+ (void)removeCognitoIdentityUserPoolForKey:(NSString *)key;
+ (AWSCognitoIdentityUserPoolConfiguration *)buildUserPoolConfiguration:(nullable AWSServiceInfo *) serviceInfo;
/**
Sign up a new user
*/
- (AWSTask<AWSCognitoIdentityUserPoolSignUpResponse *> *)signUp:(NSString *)username
password:(NSString *)password
userAttributes:(nullable NSArray<AWSCognitoIdentityUserAttributeType *> *)userAttributes
validationData:(nullable NSArray<AWSCognitoIdentityUserAttributeType *> *)validationData
clientMetaData:(nullable NSDictionary<NSString *, NSString*> *) clientMetaData;
- (AWSTask<AWSCognitoIdentityUserPoolSignUpResponse *> *)signUp:(NSString *)username
password:(NSString *)password
userAttributes:(nullable NSArray<AWSCognitoIdentityUserAttributeType *> *)userAttributes
validationData:(nullable NSArray<AWSCognitoIdentityUserAttributeType *> *)validationData;
/**
Return the user who last authenticated. Username may be nil if current user is unknown.
@return The last authenticated user
*/
- (nullable AWSCognitoIdentityUser *)currentUser;
/**
Return the user without a username, when username is unknown.
*/
- (AWSCognitoIdentityUser *)getUser;
/**
Return the user with a specific username
*/
- (AWSCognitoIdentityUser *)getUser:(NSString *)username;
/**
Clear the last known user only without signing out of their user session
*/
- (void) clearLastKnownUser;
/**
Clear everything from keychain, including last known user and user sessions for all users.
*/
- (void) clearAll;
@end
Swift
class AWSCognitoIdentityUserPool : NSObject
Undocumented
-
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) AWSServiceConfiguration *configuration
Swift
var configuration: UnsafeMutablePointer<Int32> { get }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) AWSCognitoIdentityUserPoolConfiguration *userPoolConfiguration
Swift
var userPoolConfiguration: AWSCognitoIdentityUserPoolConfiguration { get }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) NSString *identityProviderName
Swift
var identityProviderName: String { get }
-
Set this delegate to interactively prompt users for authentication challenges when necessary
Declaration
Objective-C
@property (nonatomic, strong) id<AWSCognitoIdentityInteractiveAuthenticationDelegate> _Nonnull delegate;
Swift
var delegate: AWSCognitoIdentityInteractiveAuthenticationDelegate { get set }
-
Fetches the Cognito User Pool instance configured in the
info.plist
underCognitoUserPool
Declaration
Objective-C
+ (nonnull instancetype)defaultCognitoIdentityUserPool;
Swift
class func `default`() -> Self
Return Value
the default instance for Cognito User Pool
-
Undocumented
Declaration
Objective-C
+ (void)registerCognitoIdentityUserPoolWithUserPoolConfiguration:(AWSCognitoIdentityUserPoolConfiguration *)userPoolConfiguration forKey:(NSString *)key;
Swift
class func registerCognitoIdentityUserPool(with userPoolConfiguration: AWSCognitoIdentityUserPoolConfiguration, forKey key: String)
-
Undocumented
Declaration
Objective-C
+ (void)registerCognitoIdentityUserPoolWithConfiguration:(nullable AWSServiceConfiguration *)configuration userPoolConfiguration:(AWSCognitoIdentityUserPoolConfiguration *)userPoolConfiguration forKey:(NSString *)key;
Swift
class func register(withConfiguration configuration: Any!, userPoolConfiguration: AWSCognitoIdentityUserPoolConfiguration, forKey key: String)
-
Undocumented
Declaration
Objective-C
+ (nullable instancetype)CognitoIdentityUserPoolForKey:(NSString *)key;
Swift
convenience init?(forKey key: String)
-
Undocumented
Declaration
Objective-C
+ (void)removeCognitoIdentityUserPoolForKey:(NSString *)key;
Swift
class func remove(forKey key: String)
-
Undocumented
Declaration
Objective-C
+ (AWSCognitoIdentityUserPoolConfiguration *)buildUserPoolConfiguration:(nullable AWSServiceInfo *) serviceInfo;
Swift
class func buildConfiguration(_ serviceInfo: Any!) -> AWSCognitoIdentityUserPoolConfiguration
-
Sign up a new user
Declaration
Objective-C
- (id)signUp:(nonnull NSString *)username password:(nonnull NSString *)password userAttributes:(nullable NSArray<AWSCognitoIdentityUserAttributeType *> *) userAttributes validationData:(nullable NSArray<AWSCognitoIdentityUserAttributeType *> *) validationData clientMetaData: (nullable NSDictionary<NSString *, NSString *> *)clientMetaData;
Swift
func signUp(_ username: String, password: String, userAttributes: [AWSCognitoIdentityUserAttributeType]?, validationData: [AWSCognitoIdentityUserAttributeType]?, clientMetaData: [String : String]?) -> Any!
-
Undocumented
Declaration
Objective-C
- (AWSTask<AWSCognitoIdentityUserPoolSignUpResponse *> *)signUp:(NSString *)username password:(NSString *)password userAttributes:(nullable NSArray<AWSCognitoIdentityUserAttributeType *> *)userAttributes validationData:(nullable NSArray<AWSCognitoIdentityUserAttributeType *> *)validationData;
Swift
func signUp(_ username: String, password: String, userAttributes: [AWSCognitoIdentityUserAttributeType]?, validationData: [AWSCognitoIdentityUserAttributeType]?) -> Any!
-
Return the user who last authenticated. Username may be nil if current user is unknown.
Declaration
Objective-C
- (nullable AWSCognitoIdentityUser *)currentUser;
Swift
func currentUser() -> AWSCognitoIdentityUser?
Return Value
The last authenticated user
-
Return the user without a username, when username is unknown.
Declaration
Objective-C
- (nonnull AWSCognitoIdentityUser *)getUser;
Swift
func getUser() -> AWSCognitoIdentityUser
-
Return the user with a specific username
Declaration
Objective-C
- (nonnull AWSCognitoIdentityUser *)getUser:(nonnull NSString *)username;
Swift
func getUser(_ username: String) -> AWSCognitoIdentityUser
-
Clear the last known user only without signing out of their user session
Declaration
Objective-C
- (void)clearLastKnownUser;
Swift
func clearLastKnownUser()
-
Clear everything from keychain, including last known user and user sessions for all users.
Declaration
Objective-C
- (void)clearAll;
Swift
func clearAll()