GCCS Authentication
#
OverviewThis document describes how to implement GCCS authentication features with the iOS SDK.
#
Feature DescriptionWith 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 RequestUse 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 ... }
#
AuthRequestResponseKey | Value | Description |
---|---|---|
rtCode | 0 | Result code |
rtMsg | String | Result message |
When the API call for authentication 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
.
More in detail can be found in the error code
#
Start AuthenticationOnce 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 ... }
#
AuthProcessResponseKey | Value | Description |
---|---|---|
status | String | Authentication 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.
#
AuthStartResponseKey | Value | Description |
---|---|---|
rtCode | 0 | Result code |
rtMsg | String | Result message |
authType | Int | Secondary 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.
#
ErrorResultKey | Value | Description |
---|---|---|
errorCode | Int | Error code |
errorMessage | String | Error message |
If API call fails, the user will receive an errorCode
More in detail can be found in the error code
#
Complete AuthenticationThis 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.
#
ParameterKey | Value | Description |
---|---|---|
isSecondaryCertification | Boolean | When 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 ... }
#
AuthCompleteResponseKey | Value | Description |
---|---|---|
rtCode | 0 | Result code |
rtMsg | String | Result message |
When the API call for authentication completion 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
.
More in detail can be found in the error code
#
Authentication ResultUse 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 ... }
#
AuthResultResponseKey | Value | Description |
---|---|---|
rtCode | 0 | Result code |
rtMsg | String | Result message |
data | String | Token |
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.
#
ErrorResultKey | Value | Description |
---|---|---|
errorCode | Int | Error code |
errorMessage | String | Error message |
If API call fails, the user will receive an errorCode
.
More in detail can be found in the error code
#
Cancel AuthenticationCall 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 ... }
#
AuthCancelResponseKey | Value | Description |
---|---|---|
rtCode | 0 | Result code |
rtMsg | String | Result message |
When the API call for authentication cancellation is successful, the rtCode
will be 0
and the authentication in-process will be canceled.
#
ErrorResultKey | Value | Description |
---|---|---|
errorCode | Int | Error code |
errorMessage | String | Error code |
If API call fails, the user will receive an errorCode
.
More in detail can be found in the error code