Device Re-registration
#
OverviewThis document describes how to implement GCCS device re-registration and integrate with the Android SDK.
#
Feature DescriptionWhat 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 DeliveryUse 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.
#
ParameterKey | Value | Description |
---|---|---|
userKey | String | User ID/Key |
name | String | Name |
String |
#
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()); }});
#
RegisterOtpResponseKey | Value | Description |
---|---|---|
rtCode | 0 | Result code |
rtMsg | String | Result message |
seq | Int | seq |
When the API call to verify the user and deliver OTP code is successful, the rtCode
will be 0
.
#
ErrorResultKey | Value | Description |
---|---|---|
errorCode | Int | Error code |
errorMessage | String | Error message |
If API call fails, the user will receive an errorCode
.
#
Verifying Email AuthenticationIt 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.
#
ParameterName | Value | Description |
---|---|---|
String | Email address to be authenticated | |
seq | Int | Authentication request seq |
authNum | String | Authentication 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()); }});
#
VerityOtpResponseKey | Value | Description |
---|---|---|
rtCode | 0 | Result code |
result | Boolean | Check the correctness of verifying code |
token | String | Token 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
.
#
ErrorResultKey | Value | Description |
---|---|---|
errorCode | 0 | Error code |
When failed to call API that checks duplication of register information, it returns errorCode
.
#
Device re-registrationUse 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.
#
ParameterKey | Value | Description |
---|---|---|
userKey | String | user key |
name | String | Name |
disposeToken | String | Email 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()); }});
#
RegisterUserResponseKey | Value | Description |
---|---|---|
rtCode | 0 | Result code |
rtMsg | String | Result message |
When the API call to re-register is successful, the rtCode
will be 0
#
ErrorResultKey | Value | Description |
---|---|---|
errorCode | Int | Error code |
errorMessage | String | Error message |
If API call fails, the user will receive an errorCode