IdPCallback

public class IdPCallback : MultipleValuesCallback

IdPCallback is a representation of Social Provider Handler Node in AM when Client Type option specified as NATIVE (only available in AM 7.1 and above)

Properties

  • Selected identity provider client information

    Declaration

    Swift

    public var idpClient: IdPClient

Init

  • Designated initialization method for IdPCallback

    Throws

    AuthError.invalidCallbackResponse for invalid callback response

    Declaration

    Swift

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

    Parameters

    json

    JSON object of SelectIdPCallback

Public

  • Builds input response for callback

    Declaration

    Swift

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

    Return Value

    JSON value for callback

Sign-in

  • Signs-in with selected Identity Provider using IdPHandler protocol; if IdPHandler is not provided, SDK will use default implementation of IdPHandler for google, facebook, and apple based on IdPClient‘s provider value.

    Note: signIn() method automatically sets token and tokenType values if provided using .setToken(), and .setTokenType() methods.

    Declaration

    Swift

    public func signIn(handler: IdPHandler? = nil, presentingViewController: UIViewController? = nil, completion: @escaping SocialLoginCompletionCallback)

    Parameters

    handler

    Optional IdPHandler instance to perform social login; if not provided, SDK automatically selects the default IdPHandler implementation based on IdPClient.provider value (google, facebook, and apple; case insensitive)

    presentingViewController

    Currently presenting UIViewController to present modal view for authorization using provider’s SDK. For certain providers, UIViewController must be presented.

    completion

    Completion callback to notify the result

Set values

  • Sets token_type value in callback response

    Declaration

    Swift

    public func setTokenType(_ tokenType: String)

    Parameters

    tokenType

    String value of token_type; can be either one of id_token, access_token, or authorization_code

  • Sets token value in callback response

    Declaration

    Swift

    public func setToken(_ token: String)

    Parameters

    token

    String value of obtained credentials from the provider