From: harshdeep Date: Tue, 23 Feb 2016 10:49:06 +0000 (+0530) Subject: [SAMPLE APP][FIDO-CLIENT] Initial guide for tizen_3.0 X-Git-Tag: tizen_3.0/TD_SYNC/20161201~158^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae0f5811279f0e92e16c2a1413bc39df6afbbf0b;p=sdk%2Fonline-doc.git [SAMPLE APP][FIDO-CLIENT] Initial guide for tizen_3.0 Change-Id: I97b6773889445f5bae8be03f66231df4b59550a8 Signed-off-by: harshdeep --- diff --git a/org.tizen.sampledescriptions/html/images/fido_client_authentication.png b/org.tizen.sampledescriptions/html/images/fido_client_authentication.png new file mode 100644 index 0000000..73ad08a Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/fido_client_authentication.png differ diff --git a/org.tizen.sampledescriptions/html/images/fido_client_check_uaf_supported.png b/org.tizen.sampledescriptions/html/images/fido_client_check_uaf_supported.png new file mode 100644 index 0000000..5d5ee80 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/fido_client_check_uaf_supported.png differ diff --git a/org.tizen.sampledescriptions/html/images/fido_client_dereg.png b/org.tizen.sampledescriptions/html/images/fido_client_dereg.png new file mode 100644 index 0000000..7c128f2 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/fido_client_dereg.png differ diff --git a/org.tizen.sampledescriptions/html/images/fido_client_find_.png b/org.tizen.sampledescriptions/html/images/fido_client_find_.png new file mode 100644 index 0000000..d71a501 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/fido_client_find_.png differ diff --git a/org.tizen.sampledescriptions/html/images/fido_client_find_authenticator.png b/org.tizen.sampledescriptions/html/images/fido_client_find_authenticator.png new file mode 100644 index 0000000..9dc8031 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/fido_client_find_authenticator.png differ diff --git a/org.tizen.sampledescriptions/html/images/fido_client_main.png b/org.tizen.sampledescriptions/html/images/fido_client_main.png new file mode 100644 index 0000000..7973fcf Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/fido_client_main.png differ diff --git a/org.tizen.sampledescriptions/html/images/fido_client_reg.png b/org.tizen.sampledescriptions/html/images/fido_client_reg.png new file mode 100644 index 0000000..13b1b3b Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/fido_client_reg.png differ diff --git a/org.tizen.sampledescriptions/html/images/fido_client_set_server_result.png b/org.tizen.sampledescriptions/html/images/fido_client_set_server_result.png new file mode 100644 index 0000000..7c128f2 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/fido_client_set_server_result.png differ diff --git a/org.tizen.sampledescriptions/html/mobile_n/fido_client_sd_mn .htm b/org.tizen.sampledescriptions/html/mobile_n/fido_client_sd_mn .htm new file mode 100644 index 0000000..2301a97 --- /dev/null +++ b/org.tizen.sampledescriptions/html/mobile_n/fido_client_sd_mn .htm @@ -0,0 +1,245 @@ + + + + + + + + + + + + + Fido-client Sample Overview + + + + +
+
+ +
+
+

Mobile native

+
+ +

FIDO Client Sample Overview

+ +

The Fido-client sample application demonstrates how to use fido authentication.

+

The following figure illustrates the main view of the Fido-client application in its normal state.

+

This sample application is done using predefined uaf protocol messages. If you want to test with actual FIDO server then you need to replace the json values with server specific parameters.

+ +

Figure: Fido-client main view

+

Fido-client main view

+ +

Prerequisites

+
    +
  • FIDO-UAF should be supported by the device.
  • +
+ +

Implementation

+ +

We have used hard-coded json value for registeration, authentication and derigsteration. The json files are stored in ../Fido_sample/res.

+

In this sample application, information(use) for fido uaf application api's have been provided. For more information, click here.

+ +

Find Authenticator

+ +

Find Authenticator function is used to obtain the list of all available authenticators.

+ +

Figure: Find Authenticator

+

Find Authenticator

+ +
  • After you click Find Authenticator on the main screen, the discover response will be displayed as a pop up (as shown in the above figure).

  • + +
    +void
    +start_discover(void *data, Evas_Object *obj, void *event_info)
    +{
    +   int ret = fido_foreach_authenticator(auth_list_cb, data);
    +
    +   if (ret != FIDO_ERROR_NONE)
    +      __show_error(ret, (appdata_s *)data);
    +}
    +
    + + +

    Check UAF Message Supported

    + +

    This function checks whether the given UAF protocol message can be processed by the device.

    + +

    Figure: Check UAF Message Supported

    + +

    Check UAF Message Supported

    + +
  • After you click Check UAF Message Supported on the main screen, on success 'TRUE' will be displayed in a pop up (as shown in the above figure).

  • + +
    +void
    +start_check_policy(void *data, Evas_Object *obj, void *event_info)
    +{
    +   int ret = fido_request_is_supported(json_reg, _policy_cb, data);
    +}
    +
    + +

    Protocol Conversation

    + +

    The core UAF protocol consists of conceptual conversations between a FIDO UAF Client and FIDO Server.

    + +
    1. Registeration.

    2. +

      UAF allows the relying party to register a FIDO Authenticator with the user's account at the relying party. The relying party can specify a policy for supporting various FIDO Authenticator types. A FIDO UAF Client will only register existing authenticators in accordance with that policy.

      + +

      Figure: Registeration

      +

      Registeration

      + +

      After you click Registeration on the main screen, the registeration response message is visible on the home screen as a pop-up (as shown in the above figure).

      + +
      +void
      +start_registration(void *data, Evas_Object *obj, void *event_info)
      +{
      +   if (json_reg != NULL) {
      +      int ret = fido_request_get_registration_response(json_reg, NULL, _process_cb, data);
      +
      +      char str[2048] = {0,};
      +      str[0] = '\0';
      +      strcpy(str, "REGISTRATION RESPONSE | ");
      +      char tmp[1024] = {0,};
      +      sprintf(tmp, "ret = [%d] | ", ret);
      +      strcat(str, tmp);
      +   }
      +}
      +
      + +
    3. Authentication.

    4. +

      UAF allows the relying party to prompt the end user to authenticate using a previously registered FIDO Authenticator. This authentication can be invoked any time, at the relying party's discretion.

      + +

      Figure: Authentication

      +

      Authentication

      + +

      After you click Authentication on the main screen, authentication response message is visible on the home screen as a pop-up (as shown in the above figure).

      + +
      +void
      +start_auth(void *data, Evas_Object *obj, void *event_info)
      +{
      +   if (json_auth != NULL) {
      +      int ret = fido_request_get_authentication_response(json_auth, NULL, _process_cb, data);
      +
      +      char str[2048] = {0,};
      +      str[0] = '\0';
      +      strcpy(str, "AUTHENTICATION RESPONSE | ");
      +      char tmp[1024] = {0,};
      +      sprintf(tmp, "ret = [%d] | ", ret);
      +      strcat(str, tmp);
      +   }
      +}
      +
      + +
    5. Deregistration.

    6. +

      The relying party can trigger the deletion of the account-related authentication key material.

      + +

      Figure: Deregistration

      +

      Deregistration

      + +

      After you click Deregistration on the main screen, on successful operation 'SUCCESS' message response is visible on the home screen as a pop-up (as shownin the above figure).

      + +
      +void
      +start_de_registration(void *data, Evas_Object *obj, void *event_info)
      +{
      +   if (json_reg != NULL) {
      +      int ret = fido_request_get_deregistration_response(json_dereg, NULL, _process_dereg_cb, data);
      +
      +      char str[2048] = {0,};
      +      str[0] = '\0';
      +      strcpy(str, "DE-REGISTRATION RESPONSE | ");
      +      char tmp[1024] = {0,};
      +      sprintf(tmp, "ret = [%d] | ", ret);
      +      strcat(str, tmp);
      +   }
      +}
      +
    + +

    Set Server Result

    + +

    Set Server Result is used to indicate the status code resulting from a FIDO UAF message delivered to the remote server.

    +
    1. Set Server Result with Success

    2. +
    3. Set Server Result with Failure

    4. + +

      Figure: Set Server Result

      +

      Set Server Result

      + +

      After you click Set Server Result on the main screen, on successful operation 'SUCCESS' message response is visible on the home screen as a pop-up (as shown in the above figure).

    + +
    1. Set Server Result with Success

    2. + +
      +void
      +start_notify_pos(void *data, Evas_Object *obj, void *event_info)
      +{
      +   if (json_reg != NULL)
      +      int ret = fido_uaf_get_response_message(json_reg, NULL, _process_cb_for_notify_pos, data);
      +}
      +
      +static void
      +_process_cb_for_notify_pos(fido_error_e tizen_error_code, const char *uaf_response, void *user_data)
      +{
      +   if (tizen_error_code == 0) {
      +      int ret = fido_uaf_set_server_result(FIDO_SERVER_STATUS_CODE_OK, uaf_response);
      +
      +      char *error_string = get_error_code(tizen_error_code);
      +      create_popup(error_string, (appdata_s *) user_data);
      +      free(error_string);
      +   }
      +   else {
      +      __show_error(tizen_error_code, (appdata_s *)user_data);
      +   }
      +}
      +
      +static void
      +__show_error(int tizen_error_code, appdata_s *app_data)
      +{
      +   char *error_string = get_error_code(tizen_error_code);
      +   create_popup(error_string, app_data);
      +   free(error_string);
      +}
      +
      + +
    3. Set Server Result with Failure

    4. + +
      +void
      +start_notify_neg(void *data, Evas_Object *obj, void *event_info)
      +{
      +   if (json_reg != NULL)
      +      int ret = fido_uaf_get_response_message(json_reg, NULL, _process_cb_for_notify_neg, data);
      +}
      +
      +static void
      +_process_cb_for_notify_neg(fido_error_e tizen_error_code, const char *uaf_response, void *user_data)
      +{
      +   if (tizen_error_code == 0) {
      +      int ret = fido_uaf_set_server_result(0, uaf_response);
      +
      +      char *error_string = get_error_code(tizen_error_code);
      +      create_popup(error_string, (appdata_s *) user_data);
      +      free(error_string);
      +   }
      +   else {
      +      __show_error(tizen_error_code, (appdata_s *)user_data);
      +   }
      +}
      +
    + + + +
    + +Go to top + + + + +