AsyncClientSecurityCallback<T extends Credentials> typedef

AsyncClientSecurityCallback<T extends Credentials> = Future<T?> Function(Uri uri, AugmentedForm? form, T? invalidCredentials)

Function signature for an asynchronous callback for providing client Credentials at runtime.

Users can retrieve or generate credentials based on the endpoint's uri. In the case of interactions, the corresponding Form is also retrieved.

If no credentials can be retrieved, a null value should be returned (which will lead to the throw of an exception in the respective binding). This behavior might change in future versions of dart_wot.

If the authorization/authentication fails with the given credentials, the callback will be invoked again, containing the invalidCredentials as a set argument.

This callback signature is currently only used for PskCredentials due to implementation limitations, which do not allow for asynchronous callbacks.

Implementation

typedef AsyncClientSecurityCallback<T extends Credentials> = Future<T?>
    Function(Uri uri, AugmentedForm? form, T? invalidCredentials);