TGFFido2RequestFactory

Objective-C


@interface TGFFido2RequestFactory : NSObject

Swift

class TGFFido2RequestFactory : NSObject

A factory class used to create instances of TGFFido2Request from various sources, such as a JSON string or a native passkey request object.

@since 1.0.0

  • Parses a FIDO2 request from a JSON string into a TGFFido2Request object.

    Declaration

    Objective-C

    + (TGFFido2Request *_Nullable)
        requestWithJsonString:(nonnull NSString *)json
                        error:(NSError *_Nullable *_Nullable)error;

    Swift

    class func request(_ json: String) throws -> TGFFido2Request

    Parameters

    json

    The FIDO2 request, formatted as a JSON string.

    error

    On input, a pointer to an error object. If parsing fails, this pointer is set to an NSError object containing information about the failure. You may specify nil for this parameter if you are not interested in the error information.

    Return Value

    A TGFFido2Request object on success, or nil if parsing fails.

  • Parses a FIDO2 request from a native ASPasskeyCredentialRequest into a TGFFido2Request object.

    Warning

    This method MUST only be used when handling requests for hybrid authenticators (e.g., using a phone to sign in on a nearby computer).

    @since 4.0.0

    Declaration

    Objective-C

    + (TGFFido2Request *_Nullable)
        requestWithPasskeyCredentialRequest:
            (nonnull ASPasskeyCredentialRequest *)request
                                      error:(NSError *_Nullable *_Nullable)error;

    Swift

    class func request(_ request: ASPasskeyCredentialRequest) throws -> TGFFido2Request

    Parameters

    request

    An ASPasskeyCredentialRequest object provided by the system.

    error

    On input, a pointer to an error object. If parsing fails, this pointer is set to an NSError object containing information about the failure. You may specify nil for this parameter if you are not interested in the error information.

    Return Value

    A TGFFido2Request object on success, or nil if parsing fails.