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#
| Name | Value | Description |
|---|---|---|
| AuthRequestType | AuthRequestType.NORMAL | Normal authentication type |
| userKey | String | User 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#
| Key | Value | Description |
|---|---|---|
| rtCode | 0 | Result 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#
| Key | Value | Description |
|---|---|---|
| errorCode | Int | Error code |
| errorMessage | String | Error 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#
| Name | Value | Description |
|---|---|---|
| AuthRequestType | AuthRequestType.APP | App authentication type |
| userKey | String | User 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#
| Name | Value | Description |
|---|---|---|
| rtCode | 0 | Result code |
| token | 0 | Token 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#
| Key | Value | Description |
|---|---|---|
| errorCode | Int | Error code |
| errorMessage | String | Error 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=60It 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#
| Name | Value | Description |
|---|---|---|
| AuthRequestType | AuthRequestType.QR | App authentication type |
| userKey | String | User key |
| qrData | String | QR 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#
| Name | Value | Description |
|---|---|---|
| rtCode | 0 | Result code |
When it succeeds to call API for the authentication result,
it returns 0 for rtCode and the requested authentication is cancelled.
ErrorResult#
| Key | Value | Description |
|---|---|---|
| errorCode | Int | Error code |
| errorMessage | String | Error 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#
| Key | Value | Description |
|---|---|---|
| rtCode | 0 | Result code |
When it succeeds to call API for the authentication result,
it returns 0 for rtCode and the ongoing authentication process is cancelled.
ErrorResult#
| Key | Value | Description |
|---|---|---|
| errorCode | Int | Error code |
| errorMessage | String | Error message |
It returns an error code when it fails to call API for the authentication cancel.