Authgear
public class Authgear
Undocumented
-
Undocumented
Declaration
Swift
public let isSSOEnabled: Bool -
Undocumented
Declaration
Swift
public let preAuthenticatedURLEnabled: Bool -
Undocumented
Declaration
Swift
public private(set) var accessToken: String? { get } -
Undocumented
Declaration
Swift
public var idTokenHint: String? { get } -
Undocumented
Declaration
Swift
public var canReauthenticate: Bool { get } -
Undocumented
Declaration
Swift
public var authTime: Date? { get } -
Undocumented
Declaration
Swift
public private(set) var sessionState: SessionState { get } -
Undocumented
Declaration
Swift
public weak var delegate: AuthgearDelegate? -
init(clientId:endpoint: tokenStorage: uiImplementation: urlSession: isSSOEnabled: preAuthenticatedURLEnabled: name: app2AppOptions: ) Undocumented
Declaration
Swift
public init( clientId: String, endpoint: String, tokenStorage: TokenStorage = PersistentTokenStorage(), uiImplementation: UIImplementation = ASWebAuthenticationSessionUIImplementation(), urlSession: URLSession = URLSession(configuration: .default), isSSOEnabled: Bool = false, preAuthenticatedURLEnabled: Bool = false, name: String? = nil, app2AppOptions: App2AppOptions = App2AppOptions( isEnabled: false, authorizationEndpoint: nil ) ) -
Declaration
Swift
public func configure( resource: String? = nil, scopes: [String]? = nil, handler: VoidCompletionHandler? = nil )Parameters
resourceDefault resource indicator (RFC 8707) for every method that accepts
resource. Aresourcegiven to a method replaces it. It is not sent to requests that do not acceptresource, such as biometric setup.scopesDefault scopes of the API Resource given in
resource, for every method that creates a new session.scopesgiven to a method replaces it. They are merged with the scopes required by the SDK. -
Undocumented
Declaration
Swift
public func application( _ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void ) -> Bool -
Undocumented
Declaration
Swift
public func scene(_ scene: UIScene, continue userActivity: NSUserActivity) -
authenticate(redirectURI:xState: prompt: uiLocales: colorScheme: wechatRedirectURI: page: authenticationFlowGroup: oauthProviderAlias: resource: scopes: handler: ) Declaration
Swift
public func authenticate( redirectURI: String, xState: String? = nil, prompt: [PromptOption]? = nil, uiLocales: [String]? = nil, colorScheme: ColorScheme? = nil, wechatRedirectURI: String? = nil, page: AuthenticationPage? = nil, authenticationFlowGroup: String? = nil, oauthProviderAlias: String? = nil, resource: String? = nil, scopes: [String]? = nil, handler: @escaping UserInfoCompletionHandler )Parameters
xStateUse this parameter to provide parameters from the client application to Custom UI. The string in xState can be accessed by the Custom UI. Ignore this parameter if default AuthUI is used
resourceResource indicator (RFC 8707). The URI of an API Resource registered in Authgear Portal. The access tokens of the resulting session, including refreshed ones, have
audset to this URI instead of the Authgear endpoint.scopesScopes of the API Resource given in
resourceto request. They are merged with the scopes required by the SDK. The scopes required by the SDK are always requested. -
reauthenticate(redirectURI:xState: uiLocales: colorScheme: wechatRedirectURI: maxAge: localizedReason: localizedCancelTitle: policy: customUIQuery: authenticationFlowGroup: oauthProviderAlias: handler: ) Declaration
Swift
public func reauthenticate( redirectURI: String, xState: String? = nil, uiLocales: [String]? = nil, colorScheme: ColorScheme? = nil, wechatRedirectURI: String? = nil, maxAge: Int? = nil, localizedReason: String? = nil, localizedCancelTitle: String? = nil, policy: BiometricLAPolicy? = nil, customUIQuery: String? = nil, authenticationFlowGroup: String? = nil, oauthProviderAlias: String? = nil, handler: @escaping UserInfoCompletionHandler )Parameters
xStateUse this parameter to provide parameters from the client application to Custom UI. The string in xState can be accessed by the Custom UI. Ignore this parameter if default AuthUI is used
-
Declaration
Swift
public func authenticateAnonymously( resource: String? = nil, scopes: [String]? = nil, handler: @escaping UserInfoCompletionHandler )Parameters
resourceResource indicator (RFC 8707). The URI of an API Resource registered in Authgear Portal. Defaults to the
resourcegiven toconfigure.scopesScopes of the API Resource given in
resourceto request. They are merged with the scopes required by the SDK. Defaults to thescopesgiven toconfigure. -
promoteAnonymousUser(redirectURI:xState: uiLocales: colorScheme: wechatRedirectURI: oauthProviderAlias: resource: scopes: handler: ) Declaration
Swift
public func promoteAnonymousUser( redirectURI: String, xState: String? = nil, uiLocales: [String]? = nil, colorScheme: ColorScheme? = nil, wechatRedirectURI: String? = nil, oauthProviderAlias: String? = nil, resource: String? = nil, scopes: [String]? = nil, handler: @escaping UserInfoCompletionHandler )Parameters
xStateUse this parameter to provide parameters from the client application to Custom UI. The string in xState can be accessed by the Custom UI. Ignore this parameter if default AuthUI is used
resourceResource indicator (RFC 8707). The URI of an API Resource registered in Authgear Portal. Defaults to the
resourcegiven toconfigure.scopesScopes of the API Resource given in
resourceto request. They are merged with the scopes required by the SDK. Defaults to thescopesgiven toconfigure. -
Undocumented
Declaration
Swift
public func logout( force: Bool = false, redirectURI: String? = nil, handler: @escaping (Result<Void, Error>) -> Void ) -
Undocumented
Declaration
Swift
public func openURL( path: String, uiLocales: [String]? = nil, colorScheme: ColorScheme? = nil, wechatRedirectURI: String? = nil, handler: VoidCompletionHandler? = nil ) -
Undocumented
Declaration
Swift
public func open( page: SettingsPage, uiLocales: [String]? = nil, colorScheme: ColorScheme? = nil, wechatRedirectURI: String? = nil ) -
Undocumented
Declaration
Swift
public func changePassword( uiLocales: [String]? = nil, colorScheme: ColorScheme? = nil, wechatRedirectURI: String? = nil, redirectURI: String, handler: VoidCompletionHandler? = nil ) -
Undocumented
Declaration
Swift
public func deleteAccount( uiLocales: [String]? = nil, colorScheme: ColorScheme? = nil, wechatRedirectURI: String? = nil, redirectURI: String, handler: VoidCompletionHandler? = nil ) -
Undocumented
Declaration
Swift
public func refreshAccessTokenIfNeeded( handler: @escaping VoidCompletionHandler ) -
Undocumented
Declaration
Swift
public func clearSessionState( handler: @escaping VoidCompletionHandler ) -
Undocumented
Declaration
Swift
public func fetchUserInfo(handler: @escaping UserInfoCompletionHandler) -
Undocumented
Declaration
Swift
public func refreshIDToken(handler: @escaping VoidCompletionHandler) -
Undocumented
Declaration
Swift
public func wechatAuthCallback(code: String, state: String, handler: VoidCompletionHandler? = nil) -
Undocumented
Declaration
Swift
public func checkBiometricSupported(policy: BiometricLAPolicy) throws -
Undocumented
Declaration
Swift
public func isBiometricEnabled() throws -> Bool -
Undocumented
Declaration
Swift
public func disableBiometric() throws -
Undocumented
Declaration
Swift
public func enableBiometric( localizedReason: String, policy: BiometricLAPolicy, constraint: BiometricAccessConstraint, localizedCancelTitle: String? = nil, handler: @escaping VoidCompletionHandler ) -
Declaration
Swift
@available(iOS 11.3, *) public func authenticateBiometric( localizedReason: String, policy: BiometricLAPolicy, localizedCancelTitle: String? = nil, resource: String? = nil, scopes: [String]? = nil, handler: @escaping UserInfoCompletionHandler )Parameters
resourceResource indicator (RFC 8707). The URI of an API Resource registered in Authgear Portal. Defaults to the
resourcegiven toconfigure.scopesScopes of the API Resource given in
resourceto request. They are merged with the scopes required by the SDK. Defaults to thescopesgiven toconfigure. -
Undocumented
Declaration
Swift
public func startApp2AppAuthentication( options: App2AppAuthenticateOptions, handler: @escaping UserInfoCompletionHandler ) -
Undocumented
Declaration
Swift
public func parseApp2AppAuthenticationRequest(userActivity: NSUserActivity) -> App2AppAuthenticateRequest? -
Undocumented
Declaration
Swift
public func approveApp2AppAuthenticationRequest( request: App2AppAuthenticateRequest, handler: @escaping (Result<Void, Error>) -> Void ) -
Undocumented
Declaration
Swift
public func rejectApp2AppAuthenticationRequest( request: App2AppAuthenticateRequest, reason: Error, handler: @escaping (Result<Void, Error>) -> Void ) -
Undocumented
Declaration
Swift
public func handleApp2AppAuthenticationResult( userActivity: NSUserActivity ) -> Bool -
Declaration
Swift
public func makePreAuthenticatedURL( webApplicationClientID: String, webApplicationURI: String, state: String?, resource: String? = nil, handler: @escaping URLCompletionHandler )Parameters
resourceResource indicator (RFC 8707) for the session of the web application. Defaults to the
resourcegiven toconfigure. -
Undocumented
Declaration
Swift
var experimental: AuthgearExperimental { get }