Skip to main content

GCCS Authentication

Overview#

This document describes how to implement GCCS authentication features with the iOS 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.

Authentication Request#

Use requestAuthRequest() from iOS SDK to call the API.
It is only available for devices registered to GCCS.

Parameter#

  • none

Example#

// Authentication requestGuardianService.sharedInstance.requestAuthRequest { rtCode, rtMsg, authType, connectIp, userKey, clientKey in        ...      } onProcess: { status in        ...    } onFailed: { errCode, errMsg in        ...    }

AuthRequestResponse#

KeyValueDescription
rtCode0Result code
rtMsgStringResult message

When the API call for authentication is successful, the rtCode will be 0.

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

If API call fails, the user will receive an errorCode.
More in detail can be found in the error code


Start Authentication#

Once the rtCode returned as 0, it is time to request for actual authentication to start.
Use requestAuthRequest() from GuardianSdk to call the API.
Authentication status is available to see throughout the process.

Parameter#

  • none

Example#

//Start authenticationGuardianService.sharedInstance.requestAuthRequest { rtCode, rtMsg, authType, connectIp, userKey, clientKey in        ...      } onProcess: { status in        ...    } onFailed: { errCode, errMsg in        ...    }

AuthProcessResponse#

KeyValueDescription
statusStringAuthentication status

After calling for authentication, GCCS authentication status will appear in order.

Below are description of each status value :

  • CreateChannel : Created the channel.
  • SelectNodes : Selected the nodes.
  • StartVerificationOfNodes : Started the verification of nodes.
  • CompleteVerificationOfNodes : Completed the verification of nodes.

AuthStartResponse#

KeyValueDescription
rtCode0Result code
rtMsgStringResult message
authTypeIntSecondary authentication type

We can check the authentication type and, with that, we can proceed the authentication process accordingly. When the API call for starting authentication is successful, the rtCode will be 0.
According to the authType, secondary authentication type can differ.

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

If API call fails, the user will receive an errorCode
More in detail can be found in the error code

Complete Authentication#

This will check whether the authentication is completed.
We can call this API by using the requestAuthResult() function from GuardianSdk.
Call API by using the requestAuthResult() from GuardianSdk after proceeding the additional/secondary authentication.

Parameter#

KeyValueDescription
isSecondaryCertificationBooleanWhen the additional authentication is successful, it will return as true
Otherwise, it will return as false

Example#

// Complete authenticationGuardianService.sharedInstance.requestAuthResult(isSecondaryCertification: true) { rtCode, rtMsg in        ...    } onFailed: { errCode, errMsg in        ...    }

AuthCompleteResponse#

KeyValueDescription
rtCode0Result code
rtMsgStringResult message

When the API call for authentication completion is successful, the rtCode will be 0.

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

If API call fails, the user will receive an errorCode.
More in detail can be found in the error code


Authentication Result#

Use getAuthResultToken() from GuardianSdk to call the API.
The token will be given if API call is successfully done.

Parameter#

  • none

Example#

// Authentication resultGuardianService.sharedInstance.getAuthResultToken { rtCode, result in        ...    } onFailed: { errCode, errMsg in        ...    }

AuthResultResponse#

KeyValueDescription
rtCode0Result code
rtMsgStringResult message
dataStringToken

When the API call for authentication result is successful, the rtCode will be 0 and the token will be given.
That token will be used for API calls such as checking authentication history.

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

If API call fails, the user will receive an errorCode.
More in detail can be found in the error code


Cancel Authentication#

Call the API by using requestAuthCancel() from GuardianSdk.
Using this API enables cancellation of the invalid authentication/authentication in-process.

Parameter#

  • none

Example#

//Cancel authenticationGuardianService.sharedInstance.requestAuthCancel { rtCode, msg in    ...    } onFailed: { errCode, errMsg in    ...    }

AuthCancelResponse#

KeyValueDescription
rtCode0Result code
rtMsgStringResult message

When the API call for authentication cancellation is successful, the rtCode will be 0 and the authentication in-process will be canceled.

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError code

If API call fails, the user will receive an errorCode.
More in detail can be found in the error code