AWSCognitoAuthConfiguration
Objective-C
@interface AWSCognitoAuthConfiguration : NSObject
Swift
class AWSCognitoAuthConfiguration : NSObject
Houses all configuration for AWSCognitoAuth
-
The app client id
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull appClientId;Swift
var appClientId: String { get } -
The optional app client secret
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *appClientSecret;Swift
var appClientSecret: String? { get } -
The scopes
Declaration
Objective-C
@property (nonatomic, readonly) NSSet<NSString *> *_Nonnull scopes;Swift
var scopes: Set<String> { get } -
uri to redirect on sign in. Must be configured as a uri scheme in your info.plist
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull signInRedirectUri;Swift
var signInRedirectUri: String { get } -
uri to redirect on sign out. Must be configured as a uri scheme in your info.plist
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull signOutRedirectUri;Swift
var signOutRedirectUri: String { get } -
The FQDN of your Cognito endpoint, something like https://mydomain.region.auth.amazoncognito.com
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull webDomain;Swift
var webDomain: String { get } -
The optional provider name to authenticate with directly instead of presenting the end user with a list of configured providers
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *identityProvider;Swift
var identityProvider: String? { get } -
The optional provider identifier to authenticate with directly instead of presenting the end user with a list of configured providers. Use this if you want to hide the provider name from the end user.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *idpIdentifier;Swift
var idpIdentifier: String? { get } -
The optional user pool id, required if you have enabled advanced security features on your pool.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *userPoolId;Swift
var userPoolId: String? { get } -
Whether user context information to drive the advanced security feature is emitted.
Declaration
Objective-C
@property (nonatomic, readonly, getter=isASFEnabled) BOOL asfEnabled;Swift
var isASFEnabled: Bool { get } -
If using iOS 11 or above, the SDK will use
SFAuthenticationSessionfor signIn and signOut operations if this flag is set. Below iOS 11, the SDK will use SFSafariViewController regardless of this setting.Declaration
Objective-C
@property (nonatomic, readonly) BOOL isSFAuthenticationSessionEnabled;Swift
var isSFAuthenticationSessionEnabled: Bool { get } -
Configuration object for CognitoAuth
Declaration
Objective-C
- (nonnull instancetype) initWithAppClientId:(nonnull NSString *)appClientId appClientSecret:(nullable NSString *)appClientSecret scopes:(nonnull NSSet<NSString *> *)scopes signInRedirectUri:(nonnull NSString *)signInRedirectUri signOutRedirectUri:(nonnull NSString *)signOutRedirectUri webDomain:(nonnull NSString *)webDomain;Swift
init(appClientId: String, appClientSecret: String?, scopes: Set<String>, signInRedirectUri: String, signOutRedirectUri: String, webDomain: String)Parameters
appClientIdThe app client id
appClientSecretThe optional app client secret
scopesSet of scopes to obtain
signInRedirectUriuri to redirect on sign in. Must be configured as a uri scheme in your info.plist
signOutRedirectUriuri to redirect on sign out. Must be configured as a uri scheme in your info.plist
webDomainThe FQDN of your Cognito endpoint, something like https://mydomain.region.auth.amazoncognito.com
-
-initWithAppClientId:appClientSecret: scopes: signInRedirectUri: signOutRedirectUri: webDomain: identityProvider: idpIdentifier: userPoolIdForEnablingASF: Configuration object for CognitoAuth
Declaration
Objective-C
- (nonnull instancetype) initWithAppClientId:(nonnull NSString *)appClientId appClientSecret:(nullable NSString *)appClientSecret scopes:(nonnull NSSet<NSString *> *)scopes signInRedirectUri:(nonnull NSString *)signInRedirectUri signOutRedirectUri:(nonnull NSString *)signOutRedirectUri webDomain:(nonnull NSString *)webDomain identityProvider:(nullable NSString *)identityProvider idpIdentifier:(nullable NSString *)idpIdentifier userPoolIdForEnablingASF:(nullable NSString *)userPoolIdForEnablingASF;Swift
init(appClientId: String, appClientSecret: String?, scopes: Set<String>, signInRedirectUri: String, signOutRedirectUri: String, webDomain: String, identityProvider: String?, idpIdentifier: String?, userPoolIdForEnablingASF: String?)Parameters
appClientIdThe app client id
appClientSecretThe optional app client secret
scopesSet of scopes to obtain
signInRedirectUriuri to redirect on sign in. Must be configured as a uri scheme in your info.plist
signOutRedirectUriuri to redirect on sign out. Must be configured as a uri scheme in your info.plist
webDomainThe FQDN of your Cognito endpoint, something like https://mydomain.region.auth.amazoncognito.com
identityProviderOptional provider name to authenticate with directly
idpIdentifierOptional provider identifier to authenticate with directly
userPoolIdForEnablingASFOptional user pool id for enabling advanced security features
-
-initWithAppClientId:appClientSecret: scopes: signInRedirectUri: signOutRedirectUri: webDomain: identityProvider: idpIdentifier: userPoolIdForEnablingASF: enableSFAuthSessionIfAvailable: Configuration object for CognitoAuth
Declaration
Objective-C
- (nonnull instancetype) initWithAppClientId:(nonnull NSString *)appClientId appClientSecret:(nullable NSString *)appClientSecret scopes:(nonnull NSSet<NSString *> *)scopes signInRedirectUri:(nonnull NSString *)signInRedirectUri signOutRedirectUri:(nonnull NSString *)signOutRedirectUri webDomain:(nonnull NSString *)webDomain identityProvider:(nullable NSString *)identityProvider idpIdentifier:(nullable NSString *)idpIdentifier userPoolIdForEnablingASF:(nullable NSString *)userPoolIdForEnablingASF enableSFAuthSessionIfAvailable:(BOOL)enableSFAuthSession;Swift
init(appClientId: String, appClientSecret: String?, scopes: Set<String>, signInRedirectUri: String, signOutRedirectUri: String, webDomain: String, identityProvider: String?, idpIdentifier: String?, userPoolIdForEnablingASF: String?, enableSFAuthSessionIfAvailable enableSFAuthSession: Bool)Parameters
appClientIdThe app client id
appClientSecretThe optional app client secret
scopesSet of scopes to obtain
signInRedirectUriuri to redirect on sign in. Must be configured as a uri scheme in your info.plist
signOutRedirectUriuri to redirect on sign out. Must be configured as a uri scheme in your info.plist
webDomainThe FQDN of your Cognito endpoint, something like https://mydomain.region.auth.amazoncognito.com
identityProviderOptional provider name to authenticate with directly
idpIdentifierOptional provider identifier to authenticate with directly
userPoolIdForEnablingASFOptional user pool id for enabling advanced security features
enableSFAuthSessionIf true, will use
SFAuthenticationSessionif available. Below iOS 11, the SDK will use SFSafariViewController regardless of this setting
View on GitHub
Install in Dash
AWSCognitoAuthConfiguration Class Reference