IdpCollector

@objc
public class IdpCollector : NSObject, Collector, ContinueNodeAware, RequestInterceptor, @unchecked Sendable

A collector class for handling Identity Provider (IdP) authorization.

  • property continueNode: The continue node.
  • property id: The unique identifier for the collector.
  • property idpType: The type of IdP.
  • property label: The label for the IdP.
  • property link: The URL link for IdP authentication.
  • property nativeHandler: The native handler for the IdP request.
  • property resumeRequest: The request to resume the DaVinci flow.
  • ContinueNode property

    Declaration

    Swift

    public var continueNode: ContinueNode?
  • id

    The unique identifier for the collector.

    Declaration

    Swift

    public var id: String { get }
  • Indicates whether the IdP is enabled.

    Declaration

    Swift

    public var idpEnabled: Bool
  • The type of IdP.

    Declaration

    Swift

    public var idpType: String
  • The label for the IdP.

    Declaration

    Swift

    public var label: String
  • The URL link for IdP authentication.

    Declaration

    Swift

    public var link: URL?
  • The native handler for the IdP request.

    Declaration

    Swift

    public var nativeHandler: IdpRequestHandler?
  • The request to resume the DaVinci flow.

    Declaration

    Swift

    public var resumeRequest: Request?
  • Initializes the IdpCollector with the given JSON input.

    Declaration

    Swift

    public required init(with json: [String : Any])
  • Initializes the IdpCollector with a value.

    Declaration

    Swift

    public func initialize(with value: Any)
  • Registers the IdpCollector with the collector factory

    Declaration

    Swift

    @objc
    public static func registerCollector()
  • Authorizes the IdP.

    Declaration

    Swift

    public func authorize(callbackURLScheme: String? = nil) async -> Result<Bool, IdpExceptions>

    Parameters

    callbackURLScheme

    The callback URL scheme.

  • Gets the default IdP handler for the Provider. It will either be AppleRequestHandler, GoogleRequestHandler, FacebookRequestHandler

    Declaration

    Swift

    @MainActor
    public func getDefaultIdpHandler(httpClient: HttpClient) -> IdpRequestHandler?

    Return Value

    The IdpRequestHandler.

RequestInterceptor

  • Intercepts the request.

    Declaration

    Swift

    public func intercept(context: FlowContext, request: Request) -> Request

    Parameters

    context

    The flow context.

    request

    The request to intercept.

  • Function returning the Payload of the IdP collector. This is a function that returns Never as a nonreturning function as the IDPCollector has no payload to return.

    Declaration

    Swift

    public func payload() -> Never?