Login-Component
This document describes how to utilize the Login-Component.
#
Get StartedThe latest version of Login-Component
is now available.
<head> <meta name="guardian-ccs-client_key" content="{CLIENT_KEY}"> <script type="text/javascript" src="https://developers.fnsvalue.co.kr/login-component/guardian.js"></script></head><body><button class="guardian_btn"></button></body>
#
Specify the versionIf necessary, specify the version on the Login-Component
URL as below.
<script type="text/javascript" src="https://developers.fnsvalue.co.kr/login-component/{VERSION}/guardian.js"></script>
- Example
<script type="text/javascript" src="https://developers.fnsvalue.co.kr/login-component/1.0.2/guardian.js"></script>
#
Functions providedIt is a description of how to get the authentication result(token) from the Login-Component.
Reserved function declaration
and Callback function setup
are two ways to get the result after the authentication is successfully done. Please refer to the following for more detailed information.
#
Specific Function DeclarationTo get the authentication result, add onGuardianSuccess
function on the script.
If successful, authentication result and the token will be given through onGuardianSuccess
so that the token can be used for GCCS functions.
onGuardianSuccess(token)
#
Examplefunction onGuardianSuccess(token) { console.log('token : ' + token);}
#
onSuccessName | Type | Description |
---|---|---|
token | String | Token |
#
Callback Function Declaration#
ConstructorA constructor to add the callback function in the Login-Component.
constructor()
#
Exampleconst gccs = new Guardian();
#
Callback Function SetupSet callback function to get the authentication result.
After the authentication is complete, the token will be returned and used for GCCS functions.
setSuccessCallback(successCallback)
#
Exampleconst gccs = new Guardian();gccs.setSuccessCallback((token) => { console.log('token : ' + token);});
#
onSuccessName | Type | Description |
---|---|---|
token | String | Token |