Callback

@objc(FRCallback)
open class Callback : NSObject

Callback class is base class, and is a representation of Callback implementation that OpenAM presents as par to of authentication flow. All Callback class must inherit from this class, and implement its own logic to handle interaction(s) with OpenAM.

Important Note

All inherited Callback class must implement and override following method as Callback is just a base class implementation due to Objective-C compatibility:

  • init method that parses raw JSON response, and assign any value accordingly to its properties
  • buildResponse() method that prepares, and builds request JSON payload for this specific Callback

Property

  • String value of Callback type

    Declaration

    Swift

    @objc
    open var type: String
  • Raw JSON response of Callback

    Declaration

    Swift

    @objc
    open var response: [String : Any]

Init

  • Constructs Callback object with raw JSON object, and allocates any required value to its instance properties accordingly

    Throws

    AuthError when invalid Callback response is passed, or missing required value for the callback

    Declaration

    Swift

    @objc
    required public init(json: [String : Any]) throws

    Parameters

    json

    Raw JSON response of the Callback

Build

  • Builds JSON request payload for the Callback

    Declaration

    Swift

    @objc
    open func buildResponse() -> [String : Any]

    Return Value

    JSON request payload for the Callback