Skip to main content

GCCS Authentication

Overview#

This document describes how to implement GCCS authentication features with the Android SDK.


Feature Description#

With GCCS authentication, the user can be verified without any password.
Throughout the whole process from authentication request to node verification, the token will be provided if the user has passed without any trouble. The token is used for API features such as checking authentication history.

Start Authentication and View the Authentication Result (Normal)#

It explains the steps to authenticate when receiving an authentication request from web or window. The authentication is proceeded when a push message, transferred by FCM, transfers the message to authMessageProcessing(). Use AuthRequestType.NORMAL for an authentication request type to call API with using startAuthentication() of GuardianSdk including user key. If successfully done, the authentication process is completed on web or window that requested the authentication.

Parameter#

NameValueDescription
AuthRequestTypeAuthRequestType.NORMALNormal authentication type
userKeyStringUser key

Example#

// Authentication resultGuardianSdk.getInstance().startAuthentication(AuthRequestType.NORMAL, "gccsuser", null, new GuardianResponseCallback<AuthResultResponse>() {    @Override    public void onSuccess(AuthResponse 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 code : " + errorResult.getErrorMessage());    }});

AuthResultResponse#

KeyValueDescription
rtCode0Result code

When it succeeds to call API for the authentication result, it returns 0 for rtCode and completes the authentication process on web or window that requested the authentication.

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

It returns an error code when it fails to call API for the authentication result. Please refer error code to know more about error codes.


Start Authentication and View the Authentication Result (APP)#

It explains the steps to authenticate when receiving an authentication request from a mobile application. Use AuthRequestType.APP for an authentication request type to call API with using startAuthentication() of GuardianSdk including user key. If successfully done, it returns token for the authentication result and the token is used to see one's authentication history and to browse the information about authentication.

Parameter#

NameValueDescription
AuthRequestTypeAuthRequestType.APPApp authentication type
userKeyStringUser key

Example#

// Authentication resultGuardianSdk.getInstance().startAuthentication(AuthRequestType.APP, "gccsuser", null, new GuardianResponseCallback<AuthResultResponse>() {    @Override    public void onSuccess(AuthResponse result) {        Log.i(TAG, "Reulst code : " + result.rtCode);        Log.i(TAG, "Token : " + result.token);    }
    @Override    public void onFailed(ErrorResult errorResult) {        Log.e(TAG, "Error code : " + errorResult.getErrorCode());        Log.e(TAG, "Error code : " + errorResult.getErrorMessage());    }});

AuthResultResponse#

NameValueDescription
rtCode0Result code
token0Token for authentication result

When it succeeds to call API for the authentication result, it returns 0 for rtCode and token, and the token is used to see one's authentication history and to browse the information about authentication.

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

It returns an error code when it fails to call API for the authentication result. Please refer error code to know more about error codes.


Start Authentication and View the Authentication Result (QR)#

It explains the steps to authenticate after scanning QR code that was generated on web or window. The result is shown as below when QR code is scanned.

otpauth://totp/1asdasdasd6b53ce9803ded5916&platform=CMMAPF001:8ed1ea11-d5eb-4dcd-b742-d934e983d3cc?secret=PPUZ5TPJUUKKIVOS&issuer=1daec78593a643e6b53ce9803ded5916&platform=CMMAPF001&algorithm=SHA1&digits=6&period=60

It starts the authentication process when the result string is passed to qrData. Use AuthRequestType.QR for an authentication request type to call API with using startAuthentication() of GuardianSdk including user key. If successfully done, the authentication process is completed on web that requested the authentication.

Parameter#

NameValueDescription
AuthRequestTypeAuthRequestType.QRApp authentication type
userKeyStringUser key
qrDataStringQR code scan value

Example#

// Authentication resultGuardianSdk.getInstance().startAuthentication(AuthRequestType.APP, "gccsuser", "{qrData}", new GuardianResponseCallback<AuthResultResponse>() {    @Override    public void onSuccess(AuthResponse 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 code : " + errorResult.getErrorMessage());    }});

AuthResultResponse#

NameValueDescription
rtCode0Result code

When it succeeds to call API for the authentication result, it returns 0 for rtCode and the requested authentication is cancelled.

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

It returns an error code when it fails to call API for the authentication result. Please refer error code to know more about error codes.


Cancel Authentication#

It calls API by cancelAuthentication() of GuardianSdk. It is used to cancel wrong authentications and to be cancelled when it has a previously ongoing authentication.

Parameter#

  • none

Example#

// Authentication CancelGuardianSdk.getInstance().cancelAuthentication(new GuardianResponseCallback<AuthResponse>() {    @Override    public void onSuccess(AuthResponse 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 code : " + errorResult.getErrorMessage());    }});

AuthResponse#

KeyValueDescription
rtCode0Result code

When it succeeds to call API for the authentication result, it returns 0 for rtCode and the ongoing authentication process is cancelled.

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

It returns an error code when it fails to call API for the authentication cancel.

Please refer error code to know more about error codes.#