OutOfBandOperations
public protocol OutOfBandOperations
The OutOfBandOperations
protocol specifies the out-of-band (OOB) operations and actions exposed by the SDK.
This protocol also exposes methods to manage dispatch target entities. Dispatch targets allow to involve users in out-of-band operations.
A dispatch target describes a destination to which a NEVIS Mobile Authentication backend can dispatch a token.
For instance it can be the registration token that can be used to send Push notifications to a mobile application.
-
Processes an Out-of-Band payload and triggers the operation associated with it.
Triggering an out-of-Band operation performs an initial HTTP request to redeem the token provided in the payload before dispatching the resulting operation to the FIDO UAF Client.
Errors
In case of failure, the following errors can be returned as part of the result:
- Any kind of
NevisError
; - Any kind of
FIDOError
for FIDO-related errors. NevisError.failedOperation
with UAF status code 1498 if a dispatch target configuration is provided, and the FIDO UAF contents are successfully validated but it is not possible to create the dispatch target.
Declaration
Swift
func process(payload: OutOfBandPayload, dispatchTargetConfiguration: DispatchTargetConfiguration?, userInteractionDelegate: UserInteractionDelegate, completion handler: @escaping (Result<Operation, Error>) -> ())
Parameters
payload
Payload used to start an out-of-band operation. This payload can be retrieved from a channel like a push notification or a QR code.
dispatchTargetConfiguration
An optional configuration to be provided if the registration together with dispatch target is intended. This prevents the client from having to create a dispatch target separately.
userInteractionDelegate
A delegate object responsible for handling user interaction on the current FIDO operation.
handler
A completion handler executed when the token redemption is completed.
result
A single argument that represents either a successful operation or a failure with an error.
- Any kind of
-
Updates an existing Dispatch Target.
Errors
In case of failure, the following errors can be returned as part of the result:
NevisError.invalidDispatchTarget
if the Dispatch Target cannot be updated;NevisError.generic
in case of networking, encoding or key management error.
Declaration
Swift
func updateDispatchTarget(identifier: String?, name: String?, onCompletion handler: @escaping (_ result: Result<(), Error>) -> ())
Parameters
identifier
The information required by the dispatcher to dispatch a token. If
nil
is provided, the identifier won’t be changed.name
The name describing the dispatch target. If
nil
is provided, the target name won’t be changed.handler
A completion handler executed when the update is completed.
result
A single argument that represents either a successful result or a failure with an error.
-
Deletes an existing Dispatch Target.
Errors
In case of failure, the following errors can be returned as part of the result:
NevisError.invalidDispatchTarget
if the Dispatch Target cannot be deleted;NevisError.generic
in case of networking or encoding error.
NOTE:
FIDOError.protocolError
is thrown in case of multi-account is detected.Declaration
Swift
func deleteDispatchTarget(authorizationProvider: AuthorizationProvider?, onCompletion handler: @escaping (_ result: Result<(), Error>) -> ())
Parameters
authorizationProvider
An optional
AuthorizationProvider
to provide credentials required to perform authorization, if the delete dispatch target endpoint is protected and requires authorization.handler
A completion handler executed when the deletion is completed.
result
A single argument that represents either a successful result or a failure with an error.