User registration and integration
Overview#
This document describes how to implement user registration and integration with the Android SDK.
Feature Description#
Android SDK provides features to register and integrate user into GCCS system by using the basic information.
Duplicated Registration Information Check (User Key)#
Check if there is any duplicated user key before GCCS registration process.
It requests APi by hasDuplicateUserKey() of GuardianSdk.
Parameter#
| Name | Value | Description |
|---|---|---|
| userKey | String | User key to check duplication |
Example#
// Check duplicated register informationGuardianSdk.getInstance().hasDuplicateUserKey("gccsuser", new GuardianResponseCallback<ResultResponse>() { @Override public void onSuccess(ResultResponse result) { Log.i(TAG, "Result code : " + result.rtCode); }
@Override public void onFailed(ErrorResult errorResult) { Log.e(TAG, "Error code : " + errorResult.getErrorCode()); }});ResultResponse#
| Key | Value | Description |
|---|---|---|
| rtCode | 0 | Result code |
| rtMsg | String | Result message |
It calls the Api that checks duplication of register information. When there is no duplicated information,
it returns 0 for rtCode and when duplicated information is found, it returns 2009 for rtCode.
ErrorResult#
| Key | Value | Description |
|---|---|---|
| errorCode | 0 | Error code |
When failed to call API that checks duplication of register information, it returns errorCode.
Duplicated Registration Information Check (Email)#
Check if there is any duplicated email address before GCCS registration process.
It requests APi by hasDuplicateEmail() of GuardianSdk.
Parameter#
| Name | Value | Description |
|---|---|---|
| userKey | String | Email to check duplication |
Example#
// Check duplicated register informationGuardianSdk.getInstance().hasDuplicateEmail("fnsvalue@fnsvalue.co.kr", new GuardianResponseCallback<ResultResponse>() { @Override public void onSuccess(ResultResponse result) { Log.i(TAG, "Result code : " + result.rtCode); }
@Override public void onFailed(ErrorResult errorResult) { Log.e(TAG, "Error code : " + errorResult.getErrorCode()); }});ResultResponse#
| Key | Value | Description |
|---|---|---|
| rtCode | 0 | Result code |
| rtMsg | String | Result message |
It calls the Api that checks duplication of register information. When there is no duplicated information,
it returns 0 for rtCode and when duplicated information is found, it returns 2019 for rtCode.
ErrorResult#
| Key | Value | Description |
|---|---|---|
| errorCode | 0 | Error code |
When failed to call API that checks duplication of register information, it returns errorCode.
Duplicated Registration Information Check (Phone number)#
Check if there is any duplicated phone number before GCCS registration process.
API is requested by hasDuplicatePhoneNumber() of GuardianSdk
Parameter#
| Name | Value | Description |
|---|---|---|
| userKey | String | Phone number to check duplication |
Example#
// Check duplicated register informationGuardianSdk.getInstance().hasDuplicatePhoneNumber("821012341234", new GuardianResponseCallback<ResultResponse>() { @Override public void onSuccess(ResultResponse result) { Log.i(TAG, "Result code : " + result.rtCode); }
@Override public void onFailed(ErrorResult errorResult) { Log.e(TAG, "Error code : " + errorResult.getErrorCode()); }});ResultResponse#
| Key | Value | Description |
|---|---|---|
| rtCode | 0 | Result code |
| rtMsg | String | Result message |
It calls the Api that checks duplication of register information. When there is no duplicated information,
it returns 0 for rtCode and when duplicated information is found, it returns 2019 for rtCode.
ErrorResult#
| Key | Value | Description |
|---|---|---|
| errorCode | 0 | Error code |
When failed to call API that checks duplication of register information, it returns errorCode.
Requesting Email Authentication#
It requires email authentication for GCCS registration.
API is requested through requestOtpEmail() of GuardianSdk for email authentication request.
When email authentication is successfully requested, a verifying code for registration is sent to the email address.
Parameter#
| Name | Value | Description |
|---|---|---|
| String | Email for verifying code |
Example#
// Check duplicated register informationGuardianSdk.getInstance().requestOtpEmail("fnsvalue@fnsvalue.co.kr", new GuardianResponseCallback<RequestOtpEmailResponse>() { @Override public void onSuccess(RequestOtpEmailResponse result) { Log.i(TAG, "Result code : " + result.rtCode); }
@Override public void onFailed(ErrorResult errorResult) { Log.e(TAG, "Error code : " + errorResult.getErrorCode()); }});DuplicateResponse#
| Key | Value | Description |
|---|---|---|
| rtCode | 0 | Result code |
| seq | 0 | Register authentication seq |
| rtMsg | String | Result message |
It calls the Api that checks duplication of register information. When there is no duplicated information,
it returns 0 for rtCode and when duplicated information is found, it returns 2019 for rtCode.
ErrorResult#
| Key | Value | Description |
|---|---|---|
| errorCode | 0 | Error code |
When failed to call API that checks duplication of register information, it returns 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#
| Name | 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()); }});VerityOtpResponse#
| Key | Value | Description |
|---|---|---|
| rtCode | 0 | Result code |
| result | Boolean | Check the correctness of verifying code |
| token | String | Register authentication token |
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#
| Key | Value | Description |
|---|---|---|
| errorCode | 0 | Error code |
When failed to call API that checks duplication of register information, it returns errorCode.
GCCS Registration#
API is requested through registerUser() of GuardianSdk for GCCS registration.
It requires token that was given by the API to verify email authentication including the basic information.
Parameter#
| Name | Value | Description |
|---|---|---|
| userKey | String | User key |
| name | String | Name |
| phoneNum | String | Phone number |
| String | ||
| disposeToken | String | Email authentication token |
Example#
// GCCS registrationGuardianSdk.getInstance().registerUser("gccsuser","gccsname", "fnsvalue@fnsvalue.co.kr", "821014231234", "{token}" new GuardianResponseCallback<RegisterUserResponse>() { @Override public void onSuccess(RegisterUserResponse result) { ... }
@Override public void onFailed(ErrorResult errorResult) { ... }});RegisterUserResponse#
| Key | Value | Description |
|---|---|---|
| rtCode | 0 | Result code |
| rtMsg | String | Result message |
When API for GCCS registration is successfully called, 0 is returned for rtCode and registration is completed.
ErrorResult#
| Key | Value | Description |
|---|---|---|
| errorCode | 0 | Error code |
When failed to call API for GCCS registration, errorCode is returned.
User account deactivation#
To deactivate the account, use unRegisterUser() from GuardianSdk to call the API.
Deactivating the account means that the user won't be able to use GCCS authentication.
Furthermore, the device will be sorted out as a deactivated device at the user status.
Reactivating the user account is viable through re-registration. More in detail can be found in the Device Re-registration
To deactivate a user, it requires token that was given for log-in.
Parameter#
| Name | Value | Description |
|---|---|---|
| token | String | Sign-in token |
Example#
// User account deactivationGuardianSdk.getInstance().unRegisterUser("{token}", new GuardianResponseCallback<ResultResponse>() { @Override public void onSuccess(ResultResponse result) { Log.i(TAG, "Result code : " + result.rtCode); }
@Override public void onFailed(ErrorResult errorResult) { Log.e(TAG, "Error code : " + errorResult.getErrorCode()); }});UnRegisterClientUserResponse#
| Key | Value | Description |
|---|---|---|
| rtCode | 0 | Result code |
| rtMsg | String | Result message |
When the API call for user deactivation is successful, the rtCode will be 0.
The user account deactivation is complete then.
ErrorResult#
| Key | Value | Description |
|---|---|---|
| errorCode | 0 | Error code |
If API call fails, the user will receive an errorCode.