FRSession
@objc
public class FRSession : NSObject
FRSession represents a session authenticated by AM’s Authentication Tree
-
Singleton instance represents currently authenticated session.
Note
If SDK has not been started using FRAuth.start(), FRSession.currentSession returns nil even if session has previously authenticated, and valid. When Session Token does not exist in Keychain Service, FRSession.currentSession also returns nil even if SDK has properly started.
Declaration
Swift
@objc public static var currentSession: FRSession? { get } -
Session Token object
Declaration
Swift
@objc public var sessionToken: Token? { get }
-
Invokes /authenticate endpoint in AM to go through Authentication Tree flow with given PolicyAdvice information
Declaration
Swift
@objc public static func authenticate(policyAdvice: PolicyAdvice, completion: @escaping NodeCompletion<Token>)Parameters
policyAdvicePolicyAdvice object which contains the information for authorization
completionNodeCompletion callback which returns the result of Session Token as Token object
-
Invokes /authenticate endpoint in AM to go through Authentication Tree flow with specified authIndexValue and authIndexType; authIndexType is an optional parameter defaulted to ‘service’ if not defined
Declaration
Swift
@objc public static func authenticate(authIndexValue: String, authIndexType: String = "service", completion: @escaping NodeCompletion<Token>)Parameters
authIndexValueauthIndexValue; Authentication Tree name value in String
authIndexTypeauthIndexType; Authentication Tree type value in String
completionNodeCompletion callback which returns the result of Session Token as Token object
-
Invokes /authenticate endpoint in AM to go through Authentication Tree flow with
resumeURIandsuspendedIdto resume Authentication Tree flow.Declaration
Swift
@objc public static func authenticate(resumeURI: URL, completion: @escaping NodeCompletion<Token>)Parameters
resumeURIResume URI received in Email from Suspend Email Node; URI must contain
suspendedIdin URL query parametercompletionNodeCompletion callback which returns the result of Session Token as Token object
-
Invalidates Session Token using AM’s REST API
Declaration
Swift
@objc public func logout()
View on GitHub