SKTAuthenticationDelegate

Objective-C

@protocol SKTAuthenticationDelegate <NSObject>

Swift

protocol SKTAuthenticationDelegate : NSObjectProtocol

@discussion Delegate protocol for events related to authentication.

Creating a delegate is optional, and may be used to receive callbacks for important authentication events.

  • @abstract Notifies the delegate that the current jwt used to authenticate requests is invalid.

    @discussion Called when a request fails due to an invalid jwt. Use completionHandler to update the token and automatically retry the failed request. If the updated jwt is also invalid, this method is called again, with a maximum of 5 retry attempts per request.

    Declaration

    Objective-C

    - (void)onInvalidToken:(nonnull NSError *)error
                   handler:
                       (nonnull SKTAuthenticationCompletionBlock)completionHandler;

    Swift

    optional func onInvalidToken(_ error: Error) async -> String

    Parameters

    error

    Error object for the request

    completionHandler

    Block to call with the updated jwt