Tizen Native API  8.0
Web Authentication

The Web Authentication module provides a native API enabling the creation and use of strong, attested, scoped, public key-based credentials by web applications, for the purpose of strongly authenticating users.

Required Header

#include <webauthn.h>

Overview

It provides functions for creating public key-based credentials (wauthn_make_credential()) and using them (wauthn_get_assertion()). Both these operation are being performed asynchronously. Callbacks passed as arguments are used to notify about the progress or when user's interaction is necessary. Due to significant amount of time required to complete both requests, cancellation is also possible using wauthn_cancel(). The module also provides a variety of data types based on W3C Web Authentication API (https://www.w3.org/TR/webauthn-3/) used to control the credential creation and assertion process.

Related Features

This module is related with the following features:

  • http://tizen.org/feature/security.webauthn
  • http://tizen.org/feature/network.bluetooth.le
  • and at least one of the below features:
    • http://tizen.org/feature/network.wifi
    • http://tizen.org/feature/network.ethernet
    • http://tizen.org/feature/network.telephony

It is recommended to use features in your application for reliability.
You can check if the device supports the related features for this API by using System Information, and control your application's actions accordingly.
To ensure your application is running only on devices with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on using features in your application can be found in the feature element description.

Functions

int wauthn_set_api_version (int api_version_number)
 Sets API version that the caller uses.
int wauthn_supported_authenticators (unsigned int *supported)
 Gets information on authenticator types that the client platform supports.
int wauthn_make_credential (const wauthn_client_data_s *client_data, const wauthn_pubkey_cred_creation_options_s *options, wauthn_mc_callbacks_s *callbacks)
 Makes a new web authentication credential and store it to authenticator.
int wauthn_get_assertion (const wauthn_client_data_s *client_data, const wauthn_pubkey_cred_request_options_s *options, wauthn_ga_callbacks_s *callbacks)
 Gets assertion from authenticator.
int wauthn_cancel (void)
 Stops operation of the previous wauthn_make_credential() or wauthn_get_assertion() call.

Typedefs

typedef enum
__wauthn_authenticator_transport 
wauthn_authenticator_transport_e
 WebAuthn authenticator transports.
typedef enum
__wauthn_hash_algorithm 
wauthn_hash_algorithm_e
 WebAuthn hash algorithms. Currently one hash algorithm is used, namely "SHA-256".
typedef enum
__wauthn_cose_algorithm 
wauthn_cose_algorithm_e
 WebAuthn COSE (CBOR Object Signing and Encryption) algorithms.
typedef enum
__wauthn_attestation_pref 
wauthn_attestation_pref_e
 WebAuthn attestation preference.
typedef enum
__wauthn_pubkey_cred_hint 
wauthn_pubkey_cred_hint_e
 WebAuthn public key credential hint value.
typedef enum
__wauthn_user_verification_requirement 
wauthn_user_verification_requirement_e
 WebAuthn user verification requirement value.
typedef enum
__wauthn_resident_key_requirement 
wauthn_resident_key_requirement_e
 WebAuthn resident key requirement value.
typedef enum
__wauthn_authenticator_attachment 
wauthn_authenticator_attachment_e
 WebAuthn authentication attachment value.
typedef enum
__wauthn_pubkey_cred_type 
wauthn_pubkey_cred_type_e
 WebAuthn credential type. Currently one credential type is defined, namely "public-key".
typedef struct
__wauthn_const_buffer 
wauthn_const_buffer_s
 The structure for const binary buffer used in this Native API.
typedef struct
__wauthn_authenticator_attestation_response 
wauthn_authenticator_attestation_response_s
 The structure for response of wauthn_make_credential().
typedef struct
__wauthn_authenticator_assertion_response 
wauthn_authenticator_assertion_response_s
 The structure for response of wauthn_get_assertion().
typedef struct __wauthn_rp_entity wauthn_rp_entity_s
 The structure for a RP entity.
typedef struct __wauthn_user_entity wauthn_user_entity_s
 The structure for a user entity.
typedef struct
__wauthn_pubkey_cred_param 
wauthn_pubkey_cred_param_s
 The structure for a parameter for credential generation.
typedef struct
__wauthn_pubkey_cred_params 
wauthn_pubkey_cred_params_s
 The list structure for parameters for credential generation.
typedef struct
__wauthn_pubkey_cred_descriptor 
wauthn_pubkey_cred_descriptor_s
 The structure for a public key credential descriptor.
typedef struct
__wauthn_pubkey_cred_descriptors 
wauthn_pubkey_cred_descriptors_s
 The list structure for public key credential descriptors.
typedef struct
__wauthn_authentication_ext 
wauthn_authentication_ext_s
 The structure for an authentication extension.
typedef struct
__wauthn_authentication_exts 
wauthn_authentication_exts_s
 The list structure for authentication extensions.
typedef struct
__wauthn_authenticator_sel_cri 
wauthn_authenticator_sel_cri_s
 The structure for an authenticator selection criteria.
typedef struct
__wauthn_pubkey_cred_hints 
wauthn_pubkey_cred_hints_s
 The list structure for public key credential hints.
typedef struct
__wauthn_hybrid_linked_data 
wauthn_hybrid_linked_data_s
 The structure for a linked device data.
typedef struct
__wauthn_attestation_formats 
wauthn_attestation_formats_s
 The list structure for attestation formats.
typedef struct
__wauthn_pubkey_cred_creation_options 
wauthn_pubkey_cred_creation_options_s
 The structure for a make credential option.
typedef struct
__wauthn_pubkey_cred_request_options 
wauthn_pubkey_cred_request_options_s
 The structure for a get assertion option.
typedef struct
__wauthn_pubkey_credential_attestation 
wauthn_pubkey_credential_attestation_s
 The structure for a publickey_credential response for wauthn_make_credential().
typedef struct
__wauthn_pubkey_credential_assertion 
wauthn_pubkey_credential_assertion_s
 The structure for a publickey_credential response for wauthn_get_assertion().
typedef struct __wauthn_client_data wauthn_client_data_s
 The structure for a client data JSON.
typedef void(* wauthn_display_qrcode_cb )(const char *qr_contents, void *user_data)
 Invoked when a QR Code need to be displayed.
typedef void(* wauthn_mc_on_response_cb )(const wauthn_pubkey_credential_attestation_s *pubkey_cred, wauthn_error_e result, void *user_data)
 Invoked when the response for the make credential request need to be returned.
typedef void(* wauthn_ga_on_response_cb )(const wauthn_pubkey_credential_assertion_s *pubkey_cred, wauthn_error_e result, void *user_data)
 Invoked when the response for the get assertion request need to be returned.
typedef void(* wauthn_update_linked_data_cb )(const wauthn_hybrid_linked_data_s *linked_data, wauthn_error_e result, void *user_data)
 Invoked when the authenticator updates its linked device data or the authenticator disconnects.
typedef struct
__wauthn_mc_callbacks 
wauthn_mc_callbacks_s
 The structure for callback function list used to make credential.
typedef struct
__wauthn_ga_callbacks 
wauthn_ga_callbacks_s
 The structure for callback function list used to get assertion.

Defines

#define WAUTHN_API_VERSION_NUMBER   0x00000001
 Current API version.

Define Documentation

#define WAUTHN_API_VERSION_NUMBER   0x00000001

Current API version.

Since :
7.0

Typedef Documentation

The list structure for attestation formats.

Since :
7.0
Remarks:
The attestation formats are a sequence of strings that expresses the Relying Party's preference for attestation statement formats, from most to least preferable.
Each wauthn_const_buffer_s has a string of an attestation format such as packed, android-key, fido-u2f, apple, none, and so on.
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#attestation-statement-format-identifier

WebAuthn attestation preference.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enumdef-attestationconveyancepreference

The structure for an authentication extension.

Since :
7.0
See also:
wauthn_authentication_exts_s

The list structure for authentication extensions.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#client-extension-input
See also:
wauthn_authentication_ext_s

WebAuthn authentication attachment value.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enumdef-authenticatorattachment

The structure for an authenticator selection criteria.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#dictdef-authenticatorselectioncriteria
See also:
wauthn_authenticator_attachment_e
wauthn_resident_key_requirement_e
wauthn_user_verification_requirement_e

WebAuthn authenticator transports.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enum-transport
Multiple transport values can be combined using bit-wise operation.

The structure for a client data JSON.

Since :
7.0
Remarks:
Refer to the following W3C specification about how to encode the client_data_json. https://www.w3.org/TR/webauthn-3/#collectedclientdata-json-compatible-serialization-of-client-data
See also:
wauthn_hash_algorithm_e

The structure for const binary buffer used in this Native API.

Since :
7.0

WebAuthn COSE (CBOR Object Signing and Encryption) algorithms.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#sctn-alg-identifier
typedef void(* wauthn_display_qrcode_cb)(const char *qr_contents, void *user_data)

Invoked when a QR Code need to be displayed.

Since :
7.0
Remarks:
The qr_contents are encoded as you can see in the encodeQRContents() function of the FIDO specification: https://fidoalliance.org/specs/fido-v2.2-rd-20230321/fido-client-to-authenticator-protocol-v2.2-rd-20230321.html#hybrid-qr-initiated. The qr_contents is encoded like "FIDO:/0254318383..........7406596245".
The image to be displayed shall be created from qr_contents with media vision API(mv_barcode_generate_image()).
If the request does not need to display a QR code then this callback function won't be invoked.
The qr_contents can be used only in the callback. To use outside, make a copy.
Parameters:
[in]qr_contentsThe contents of the QR code to be displayed.
[in]user_dataThe user data passed from the callback structure, wauthn_mc_callbacks_s or wauthn_ga_callbacks_s.
 #include <mv_barcode.h>

 int ret;
 mv_engine_config_h engine_cfg = NULL;
 mv_barcode_type_e type = MV_BARCODE_QR;
 mv_barcode_qr_mode_e qr_enc_mode = MV_BARCODE_QR_MODE_UTF8;
 mv_barcode_qr_ecc_e qr_ecc = MV_BARCODE_QR_ECC_LOW;
 int qr_version = 5;
 const char* image_path = TMP_QR_FILE_PRX;
 mv_barcode_image_format_e image_format = MV_BARCODE_IMAGE_FORMAT_PNG;
 size_t image_width = 200;
 size_t image_height = 200;

 // the file, TMP_QR_FILE_PRX + ".png", will be created.
 ret = mv_barcode_generate_image(engine_cfg, qr_contents, image_width, image_height, type,
                                  qr_enc_mode, qr_ecc, qr_version, image_path, image_format);
 if (ret !=  MEDIA_VISION_ERROR_NONE) {
     std::cout << "mv_barcode_generate_image failed. ret=" << ret << std::endl;
     return -1;
 }
See also:
wauthn_mc_callbacks_s
wauthn_ga_callbacks_s

The structure for callback function list used to get assertion.

Since :
7.0
See also:
wauthn_get_assertion()
wauthn_display_qrcode_cb()
wauthn_ga_on_response_cb()
typedef void(* wauthn_ga_on_response_cb)(const wauthn_pubkey_credential_assertion_s *pubkey_cred, wauthn_error_e result, void *user_data)

Invoked when the response for the get assertion request need to be returned.

Since :
7.0
Remarks:
The pubkey_cred can be used only in the callback. To use outside, make a copy.
Parameters:
[in]pubkey_credThe public key credential contains response data.
[in]resultThe result of the request. WAUTHN_ERROR_NONE if the request is completed well, WAUTHN_ERROR_CANCELED if the request is cancelled by wauthn_cancel() request. WAUTHN_ERROR_INVALID_STATE if the server entered invalid state. Known causes:
  • proxy issues,
  • reached the limit of credentials stored by the authenticator. WAUTHN_ERROR_TIMED_OUT if the request times out. Know causes:
  • authenticator does not respond during state assisted transactions due to lack of push notifications support (e.g. missing Google Account).
[in]user_dataThe user data passed from the callback structure, wauthn_ga_callbacks_s.
See also:
wauthn_ga_callbacks_s
wauthn_pubkey_credential_assertion_s

WebAuthn hash algorithms. Currently one hash algorithm is used, namely "SHA-256".

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#collectedclientdata-hash-of-the-serialized-client-data

The structure for a linked device data.

Since :
7.0
Remarks:
The linked device data is used for state assisted transaction. From the successful QR initiated transaction, the linked device data might be returned from an authenticator to a webauthn client via wauthn_pubkey_credential_attestation_s or wauthn_pubkey_credential_assertion_s. Then the client can store the linked device data and use it in the next call for wauthn_pubkey_cred_creation_options_s or wauthn_pubkey_cred_request_options_s. Then the stated assisted transaction will start instead of QR initiated transaction.
For more information, find a section with the keyword, "linking map", from the following specification. https://fidoalliance.org/specs/fido-v2.2-rd-20230321/fido-client-to-authenticator-protocol-v2.2-rd-20230321.html
For more information about state assisted transaction, refer to the following. https://fidoalliance.org/specs/fido-v2.2-rd-20230321/fido-client-to-authenticator-protocol-v2.2-rd-20230321.html#hybrid-state-assisted

The structure for callback function list used to make credential.

Since :
7.0
See also:
wauthn_make_credential()
wauthn_display_qrcode_cb()
wauthn_mc_on_response_cb()
typedef void(* wauthn_mc_on_response_cb)(const wauthn_pubkey_credential_attestation_s *pubkey_cred, wauthn_error_e result, void *user_data)

Invoked when the response for the make credential request need to be returned.

Since :
7.0
Remarks:
The pubkey_cred can be used only in the callback. To use outside, make a copy.
Parameters:
[in]pubkey_credThe public key credential contains response data.
[in]resultThe result of the wauthn_make_credential() request. WAUTHN_ERROR_NONE if the request is completed well, WAUTHN_ERROR_CANCELED if the request is cancelled by wauthn_cancel() request. WAUTHN_ERROR_INVALID_STATE if the server entered invalid state. Known causes:
  • proxy issues,
  • reached the limit of credentials stored by the authenticator. WAUTHN_ERROR_TIMED_OUT if the request times out. Know causes:
  • authenticator does not respond during state assisted transactions due to lack of push notifications support (e.g. missing Google Account).
[in]user_dataThe user data passed from the callback structure, wauthn_mc_callbacks_s.
See also:
wauthn_mc_callbacks_s
wauthn_pubkey_credential_attestation_s

The structure for a public key credential descriptor.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#dictdef-publickeycredentialdescriptor
See also:
wauthn_pubkey_cred_type_e
wauthn_authenticator_transport_e

The list structure for public key credential descriptors.

Since :
7.0
See also:
wauthn_pubkey_cred_descriptor_s

WebAuthn public key credential hint value.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enumdef-publickeycredentialhints

The list structure for public key credential hints.

Since :
7.0
See also:
wauthn_pubkey_cred_hint_e

The structure for a parameter for credential generation.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#dictdef-publickeycredentialparameters
See also:
wauthn_pubkey_cred_type_e
wauthn_cose_algorithm_e

The list structure for parameters for credential generation.

Since :
7.0
See also:
wauthn_pubkey_cred_param_s

WebAuthn credential type. Currently one credential type is defined, namely "public-key".

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enumdef-publickeycredentialtype

WebAuthn resident key requirement value.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enum-residentKeyRequirement

The structure for a RP entity.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#dictdef-publickeycredentialrpentity
typedef void(* wauthn_update_linked_data_cb)(const wauthn_hybrid_linked_data_s *linked_data, wauthn_error_e result, void *user_data)

Invoked when the authenticator updates its linked device data or the authenticator disconnects.

Since :
7.0
Remarks:
An authenticator might send its updated linked device data to a client within 2 minutes after sending a response to the client.
If an authenticator updates its linked device data, this callback is called with WAUTHN_ERROR_NONE_AND_WAIT and not null linked_data.
If an authenticator disconnects or 2 minutes have passed after receiving wauthn_mc_on_response_cb or wauthn_ga_on_response_cb, this callback is called with WAUTHN_ERROR_NONE and null linked_data.
The linked_data can be used only in the callback. To use outside, make a copy.
Parameters:
[in]linked_dataThe Linked Device Connection Info. If this is not null, the client has to update the data for next use.
[in]resultThe result of the request. WAUTHN_ERROR_NONE_AND_WAIT if a update message has arrived and the client needs to wait for another message to arrive. WAUTHN_ERROR_NONE if the client doesn't have to to wait for another message. WAUTHN_ERROR_INVALID_STATE if the server entered invalid state. Known causes:
  • reached the limit of credentials stored by the authenticator.
[in]user_dataThe user data passed from the callback structure, wauthn_ga_callbacks_s.
See also:
wauthn_ga_callbacks_s
wauthn_hybrid_linked_data_s

The structure for a user entity.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#dictdef-publickeycredentialuserentity

WebAuthn user verification requirement value.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enumdef-userverificationrequirement

Enumeration Type Documentation

WebAuthn attestation preference.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enumdef-attestationconveyancepreference
Enumerator:
WAUTHN_ATTESTATION_PREF_NONE 

None

WAUTHN_ATTESTATION_PREF_INDIRECT 

Indirect

WAUTHN_ATTESTATION_PREF_DIRECT 

Direct

WAUTHN_ATTESTATION_PREF_ENTERPRISE 

Enterprise

WebAuthn authentication attachment value.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enumdef-authenticatorattachment
Enumerator:
WAUTHN_AUTHENTICATOR_ATTACHMENT_NONE 

None

WAUTHN_AUTHENTICATOR_ATTACHMENT_PLATFORM 

Platform

WAUTHN_AUTHENTICATOR_ATTACHMENT_CROSS_PLATFORM 

Cross-platform

WebAuthn authenticator transports.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enum-transport
Multiple transport values can be combined using bit-wise operation.
Enumerator:
WAUTHN_TRANSPORT_NONE 

No transport specified

WAUTHN_TRANSPORT_USB 

USB

WAUTHN_TRANSPORT_NFC 

NFC

WAUTHN_TRANSPORT_BLE 

BLE

WAUTHN_TRANSPORT_SMARTCARD 

Smart-card

WAUTHN_TRANSPORT_HYBRID 

Hybrid

WAUTHN_TRANSPORT_INTERNAL 

Internal

WebAuthn COSE (CBOR Object Signing and Encryption) algorithms.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#sctn-alg-identifier
Enumerator:
WAUTHN_COSE_ALGORITHM_ECDSA_P256_WITH_SHA256 

ES256

WAUTHN_COSE_ALGORITHM_ECDSA_P384_WITH_SHA384 

ES384

WAUTHN_COSE_ALGORITHM_ECDSA_P521_WITH_SHA512 

ES512

WAUTHN_COSE_ALGORITHM_EDDSA 

EdDSA

WAUTHN_COSE_ALGORITHM_RSA_PSS_WITH_SHA256 

PS256

WAUTHN_COSE_ALGORITHM_RSA_PSS_WITH_SHA384 

PS384

WAUTHN_COSE_ALGORITHM_RSA_PSS_WITH_SHA512 

PS512

WAUTHN_COSE_ALGORITHM_RSASSA_PKCS1_V1_5_WITH_SHA256 

RS256

WAUTHN_COSE_ALGORITHM_RSASSA_PKCS1_V1_5_WITH_SHA384 

RS384

WAUTHN_COSE_ALGORITHM_RSASSA_PKCS1_V1_5_WITH_SHA512 

RS512

WebAuthn hash algorithms. Currently one hash algorithm is used, namely "SHA-256".

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#collectedclientdata-hash-of-the-serialized-client-data
Enumerator:
WAUTHN_HASH_ALGORITHM_SHA_256 

SHA-256

WebAuthn public key credential hint value.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enumdef-publickeycredentialhints
Enumerator:
WAUTHN_PUBKEY_CRED_HINT_NONE 

None

WAUTHN_PUBKEY_CRED_HINT_SECURITY_KEY 

Security-key

WAUTHN_PUBKEY_CRED_HINT_CLIENT_DEVICE 

Client-device

WAUTHN_PUBKEY_CRED_HINT_HYBRID 

Hybrid

WebAuthn credential type. Currently one credential type is defined, namely "public-key".

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enumdef-publickeycredentialtype
Enumerator:
WAUTHN_PUBKEY_CRED_TYPE_PUBLIC_KEY 

Public-key

WebAuthn resident key requirement value.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enum-residentKeyRequirement
Enumerator:
WAUTHN_RESIDENT_KEY_REQUIREMENT_NONE 

None

WAUTHN_RESIDENT_KEY_REQUIREMENT_DISCOURAGED 

Discouraged

WAUTHN_RESIDENT_KEY_REQUIREMENT_PREFERRED 

Preferred

WAUTHN_RESIDENT_KEY_REQUIREMENT_REQUIRED 

Required

WebAuthn user verification requirement value.

Since :
7.0
Remarks:
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#enumdef-userverificationrequirement
Enumerator:
WAUTHN_USER_VERIFICATION_REQUIREMENT_NONE 

None

WAUTHN_USER_VERIFICATION_REQUIREMENT_REQUIRED 

Required

WAUTHN_USER_VERIFICATION_REQUIREMENT_PREFERRED 

Preferred

WAUTHN_USER_VERIFICATION_REQUIREMENT_DISCOURAGED 

Discouraged

WebAuthn Errors.

Since :
7.0
Enumerator:
WAUTHN_ERROR_NONE 

Successful

WAUTHN_ERROR_UNKNOWN 

Unknown error

WAUTHN_ERROR_INVALID_PARAMETER 

Invalid function parameter

WAUTHN_ERROR_PERMISSION_DENIED 

Permission denied

WAUTHN_ERROR_NOT_SUPPORTED 

Not supported operation

WAUTHN_ERROR_OUT_OF_MEMORY 

Memory error

WAUTHN_ERROR_CANCELED 

Canceled by cancel request

WAUTHN_ERROR_TIMED_OUT 

Timeout

WAUTHN_ERROR_CONNECTION_REFUSED 

Authenticator is uncontactable

WAUTHN_ERROR_NONE_AND_WAIT 

Successful and needs to wait for other result

WAUTHN_ERROR_NOT_ALLOWED 

Not allowed in the current context

WAUTHN_ERROR_INVALID_STATE 

Invalid State

WAUTHN_ERROR_ENCODING_FAILED 

Encoding operation failed

WAUTHN_ERROR_SOCKET 

Socket error

WAUTHN_ERROR_NO_SUCH_SERVICE 

Socket operation on non-socket error

WAUTHN_ERROR_ACCESS_DENIED 

Socket access denied


Function Documentation

int wauthn_cancel ( void  )

Stops operation of the previous wauthn_make_credential() or wauthn_get_assertion() call.

Since :
7.0
Remarks:
This function is related with following feature:
  • http://tizen.org/feature/security.webauthn
Returns:
0 on success,
Return values:
WAUTHN_ERROR_NONESuccessful
WAUTHN_ERROR_NOT_SUPPORTEDThe required feature is not supported
WAUTHN_ERROR_NOT_ALLOWEDNot allowed in the current context
See also:
wauthn_make_credential()
wauthn_get_assertion()
int wauthn_get_assertion ( const wauthn_client_data_s client_data,
const wauthn_pubkey_cred_request_options_s options,
wauthn_ga_callbacks_s callbacks 
)

Gets assertion from authenticator.

Since :
7.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
http://tizen.org/privilege/internet
Remarks:
This function is related with following features:
  • http://tizen.org/feature/security.webauthn
  • http://tizen.org/feature/network.bluetooth.le
  • and at least one of the below features:
    • http://tizen.org/feature/network.wifi
    • http://tizen.org/feature/network.ethernet
    • http://tizen.org/feature/network.telephony
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#sctn-getAssertion
Parameters:
[in]client_dataUTF-8 encoded JSON serialization of the client data
[in]optionsThis argument is a wauthn_pubkey_cred_request_options_s object specifying the desired attributes of the public key credential to discover
[in]callbacksThe callback functions to be invoked
Returns:
0 on success,
Return values:
WAUTHN_ERROR_NONESuccessful
WAUTHN_ERROR_NOT_SUPPORTEDThe required feature is not supported
WAUTHN_ERROR_PERMISSION_DENIEDRequired privilege is missing
WAUTHN_ERROR_INVALID_PARAMETERInput parameter is invalid
WAUTHN_ERROR_NOT_ALLOWEDNot allowed in the current context including busy state
WAUTHN_ERROR_CANCELEDCancelled by cancel request
WAUTHN_ERROR_CONNECTION_REFUSEDAuthenticator is permanently uncontactable. Forget link info
Precondition:
API version must be set with wauthn_set_api_version() and required authenticator type must be supported (can be checked with wauthn_supported_authenticators()).
See also:
wauthn_make_credential()
wauthn_pubkey_cred_request_options_s
wauthn_ga_callbacks_s
int wauthn_make_credential ( const wauthn_client_data_s client_data,
const wauthn_pubkey_cred_creation_options_s options,
wauthn_mc_callbacks_s callbacks 
)

Makes a new web authentication credential and store it to authenticator.

Since :
7.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
http://tizen.org/privilege/internet
Remarks:
This function is related with following features:
  • http://tizen.org/feature/security.webauthn
  • http://tizen.org/feature/network.bluetooth.le
  • and at least one of the below features:
    • http://tizen.org/feature/network.wifi
    • http://tizen.org/feature/network.ethernet
    • http://tizen.org/feature/network.telephony
Refer to the following W3C specification for more information. https://www.w3.org/TR/webauthn-3/#sctn-createCredential
Parameters:
[in]client_dataUTF-8 encoded JSON serialization of the client data.
[in]optionsThis argument is a wauthn_pubkey_cred_creation_options_s object specifying the desired attributes of the to-be-created public key credential
[in]callbacksThe callback functions to be invoked
Returns:
0 on success, otherwise a negative error value
Return values:
WAUTHN_ERROR_NONESuccessful
WAUTHN_ERROR_NOT_SUPPORTEDThe required feature is not supported
WAUTHN_ERROR_PERMISSION_DENIEDRequired privilege is missing
WAUTHN_ERROR_INVALID_PARAMETERInput parameter is invalid
WAUTHN_ERROR_NOT_ALLOWEDNot allowed in the current context including busy state
WAUTHN_ERROR_INVALID_STATEGet in an invalid state
WAUTHN_ERROR_CANCELEDCancelled by cancel request
WAUTHN_ERROR_CONNECTION_REFUSEDAuthenticator is permanently uncontactable. Forget link info
Precondition:
API version must be set with wauthn_set_api_version() and required authenticator type must be supported (can be checked with wauthn_supported_authenticators()).
See also:
wauthn_get_assertion()
wauthn_pubkey_cred_creation_options_s
wauthn_mc_callbacks_s
int wauthn_set_api_version ( int  api_version_number)

Sets API version that the caller uses.

Since :
7.0
Remarks:
This function is related with following feature:
  • http://tizen.org/feature/security.webauthn
This function must be called before other functions are called.
Parameters:
[in]api_version_numberAPI version number to set. Use WAUTHN_API_VERSION_NUMBER as an input.
Returns:
0 on success, otherwise a negative error value
Return values:
WAUTHN_ERROR_NONESuccessful
WAUTHN_ERROR_NOT_SUPPORTEDThe specified API version or required feature is not supported
int wauthn_supported_authenticators ( unsigned int *  supported)

Gets information on authenticator types that the client platform supports.

Since :
7.0
Remarks:
This function is related with following feature:
  • http://tizen.org/feature/security.webauthn
This version of API only support hybrid roaming authenticator. So the bit for WAUTHN_TRANSPORT_HYBRID is set 1 and bits for other authenticators set 0. Each authenticators can be checked using bitwise operation.
Parameters:
[out]supportedThe pointer to an unsigned int for return supported authenticators
Returns:
0 on success, otherwise a negative error value
Return values:
WAUTHN_ERROR_NONESuccessful
WAUTHN_ERROR_NOT_SUPPORTEDThe required feature is not supported
WAUTHN_ERROR_INVALID_PARAMETERThe supported is NULL
 unsigned int supported = 0;
 auto ret = wauthn_supported_authenticators(&supported);
 if (ret != WAUTHN_ERROR_NONE)
     return ret;

 if (supported & WAUTHN_TRANSPORT_HYBRID) {
     // hybrid transport is supported
 } else {
     // hybrid transport is not supported
 }
See also:
wauthn_authenticator_transport_e