DefaultSudoUserClient
public class DefaultSudoUserClient : SudoUserClient
Default implementation for SudoUserClient
.
-
Configuration parameter names.
Declaration
Swift
public struct Config
-
Declaration
Swift
public var version: String { get }
-
Intializes a new
DefaultSudoUserClient
instance. It uses configuration parameters defined insudoplatformconfig.json
file located in the app bundle.Declaration
Swift
convenience public init(keyNamespace: String, logger: Logger? = nil) throws
Parameters
keyNamespace
Namespace to use for the keys and passwords. This has to be unique per client per app to avoid different apps (with keychain sharing) or different clients creating conflicting keys.
logger
A logger to use for logging messages. If none provided then a default internal logger will be used.
-
Intializes a new
DefaultSudoUserClient
instance.Declaration
Swift
public init(config: [String: Any], keyNamespace: String, credentialsProvider: CredentialsProvider? = nil, identityProvider: IdentityProvider? = nil, apiClient: AWSAppSyncClient? = nil, authUI: AuthUI? = nil, logger: Logger? = nil) throws
Parameters
config
Configuration parameters for the client.
keyNamespace
Namespace to use for the keys and passwords.
credentialsProvider
Credentials provider to use for obtaining AWS credential. Mainly used for unit testing.
identityProvider
Identity provider to use to user management. Mainly used for unit testing. Mainly used for unit testing.
apiClient
GrpahQL client to use for Identity Service API. Mainly used for unit testing.
authUI
AuthUI used for presenting federated sign in UI. Mainly used for unit testing.
logger
A logger to use for logging messages. If none provided then a default internal logger will be used.
-
isRegistered()
AsynchronousDeclaration
Swift
public func isRegistered() async throws -> Bool
-
reset()
AsynchronousDeclaration
Swift
public func reset() async throws
-
Declaration
Swift
public func registerWithDeviceCheck( token: Data, buildType: String, vendorId: UUID, registrationId: String? ) async throws -> String
-
Declaration
Swift
public func registerWithAuthenticationProvider( authenticationProvider: AuthenticationProvider, registrationId: String? ) async throws -> String
-
deregister()
AsynchronousDeclaration
Swift
public func deregister() async throws -> String
-
resetUserData()
AsynchronousDeclaration
Swift
public func resetUserData() async throws
-
signInWithKey()
AsynchronousDeclaration
Swift
public func signInWithKey() async throws -> AuthenticationTokens
-
Declaration
Swift
public func signInWithAuthenticationProvider(authenticationProvider: AuthenticationProvider) async throws -> AuthenticationTokens
-
presentFederatedSignInUI(presentationAnchor:
Asynchronous) Declaration
Swift
public func presentFederatedSignInUI(presentationAnchor: ASPresentationAnchor) async throws -> AuthenticationTokens
-
presentFederatedSignOutUI(presentationAnchor:
Asynchronous) Declaration
Swift
public func presentFederatedSignOutUI(presentationAnchor: ASPresentationAnchor) async throws
-
processFederatedSignInTokens(url:
Asynchronous) Declaration
Swift
public func processFederatedSignInTokens(url: URL) async throws -> Bool
-
refreshTokens(refreshToken:
Asynchronous) Declaration
Swift
public func refreshTokens(refreshToken: String) async throws -> AuthenticationTokens
-
refreshTokens()
AsynchronousDeclaration
Swift
public func refreshTokens() async throws -> AuthenticationTokens
-
Declaration
Swift
public func getUserName() throws -> String?
-
Declaration
Swift
public func getSubject() throws -> String?
-
Declaration
Swift
public func getIdToken() throws -> String?
-
Declaration
Swift
public func getAccessToken() throws -> String?
-
Declaration
Swift
public func getTokenExpiry() throws -> Date?
-
Declaration
Swift
public func getRefreshTokenExpiry() throws -> Date?
-
Declaration
Swift
public func getRefreshToken() throws -> String?
-
clearAuthTokens()
AsynchronousDeclaration
Swift
public func clearAuthTokens() async throws
-
signOut()
AsynchronousDeclaration
Swift
public func signOut() async throws
-
globalSignOut()
AsynchronousDeclaration
Swift
public func globalSignOut() async throws
-
getIdentityId()
AsynchronousDeclaration
Swift
public func getIdentityId() async -> String?
-
Declaration
Swift
public func getUserClaim(name: String) throws -> Any?
-
isSignedIn()
AsynchronousDeclaration
Swift
public func isSignedIn() async throws -> Bool
-
registerSignInStatusObserver(id:
Asynchronousobserver: ) Declaration
Swift
public func registerSignInStatusObserver(id: String, observer: SignInStatusObserver) async
-
deregisterSignInStatusObserver(id:
Asynchronous) Declaration
Swift
public func deregisterSignInStatusObserver(id: String) async
-
setUserName(name:
Asynchronous) Declaration
Swift
public func setUserName(name: String) async throws
-
Declaration
Swift
public func getSupportedRegistrationChallengeType() -> [ChallengeType]