Skip to main content

Device Re-registration

Overview#

This document describes how to implement GCCS device re-registration and integrate with the Android SDK.


Feature Description#

What can be done if the user wishes to continue using GCCS after changing his/her mobile device?
It is possible to use GCCS features like before by user information verification and re-registration.
In this way, the user can use GCCS with a new mobile device.
To do so, the Android SDK will first check the user history and then verify the user by sending OTP code to their email.

User Verification and OTP Delivery#

Use verityUserToOtp() from GuardianSdk to call the API.
If the user has been verified in the past, he/she will receive the OTP code via email.

Parameter#

KeyValueDescription
userKeyStringUser ID/Key
nameStringName
emailStringEmail

Example#

// User check and OTP deliveryGuardianSdk.getInstance().verityUserToOtp(params, new GuardianResponseCallback<RegisterOtpResponse>() {    @Override    public void onSuccess(RegisterOtpResponse result) {        ...    }
    @Override    public void onFailed(ErrorResult errorResult) {        Log.e(TAG, "Error code : " + errorResult.getErrorCode());        Log.e(TAG, "Error message : " + errorResult.getErrorMessage());    }});

RegisterOtpResponse#

KeyValueDescription
rtCode0Result code
rtMsgStringResult message
seqIntseq

When the API call to verify the user and deliver OTP code is successful, the rtCode will be 0.

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

If API call fails, the user will receive an errorCode.


Verifying Email Authentication#

It verifies email authentication by seq which is a return value of requestOtpEmail(), a verifying code on email, and email address. API is requested through verityOtpEmail() of GuardianSdk for email authentication request. If the verifying code for registration is correct, token value for registration will be passed.

Parameter#

NameValueDescription
emailStringEmail address to be authenticated
seqIntAuthentication request seq
authNumStringAuthentication code

Example#

// Check duplicated register informationGuardianSdk.getInstance().verityOtpEmail("fnsvalue@fnsvalue.co.kr", 23, "452422", new GuardianResponseCallback<VerityOtpResponse>() {    @Override    public void onSuccess(VerityOtpResponse result) {        Log.i(TAG, "Result code : " + result.rtCode);        Log.i(TAG, "Token for registration : " + result.token);    }
    @Override    public void onFailed(ErrorResult errorResult) {        Log.e(TAG, "Error code : " + errorResult.getErrorCode());    }});

VerityOtpResponse#

KeyValueDescription
rtCode0Result code
resultBooleanCheck the correctness of verifying code
tokenStringToken for registration authentication

It calls the Api that verifies email authentication. When it is a correct verifying code, it returns 0 for rtCode and true for result.

ErrorResult#

KeyValueDescription
errorCode0Error code

When failed to call API that checks duplication of register information, it returns errorCode.


Device re-registration#

Use reRegisterClientUser() from GuardianSdk to call the API.
The token verified with verityOtpEmail() is required.
When the re-registration is complete, the user can utilize GCCS authentication as usual.

Parameter#

KeyValueDescription
userKeyStringuser key
nameStringName
disposeTokenStringEmail authentication token

Example#

// OTP VerificationGuardianSdk.getInstance().reRegisterUser("gccsuser", "gccsname", "{token}", new GuardianResponseCallback<RegisterUserResponse>() {    @Override    public void onSuccess(RegisterUserResponse result) {        Log.i(TAG, "Result code : " + result.rtCode);    }
    @Override    public void onFailed(ErrorResult errorResult) {        Log.e(TAG, "Error code : " + errorResult.getErrorCode());        Log.e(TAG, "Error message : " + errorResult.getErrorMessage());    }});

RegisterUserResponse#

KeyValueDescription
rtCode0Result code
rtMsgStringResult message

When the API call to re-register is successful, the rtCode will be 0

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

If API call fails, the user will receive an errorCode