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
policyAdvice
PolicyAdvice object which contains the information for authorization
completion
NodeCompletion 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
authIndexValue
authIndexValue; Authentication Tree name value in String
authIndexType
authIndexType; Authentication Tree type value in String
completion
NodeCompletion callback which returns the result of Session Token as Token object
-
Invokes /authenticate endpoint in AM to go through Authentication Tree flow with
resumeURI
andsuspendedId
to resume Authentication Tree flow.Declaration
Swift
@objc public static func authenticate(resumeURI: URL, completion: @escaping NodeCompletion<Token>)
Parameters
resumeURI
Resume URI received in Email from Suspend Email Node; URI must contain
suspendedId
in URL query parametercompletion
NodeCompletion 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()