Skip to main content

Login-Component

This document describes how to utilize the Login-Component.

Get Started#

The 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 version#

If 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 provided#

It 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 Declaration#

To 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)

Example#

function onGuardianSuccess(token) {  console.log('token : ' + token);}

onSuccess#

NameTypeDescription
tokenStringToken

Callback Function Declaration#

Constructor#

A constructor to add the callback function in the Login-Component.

constructor()

Example#

const gccs = new Guardian();

Callback Function Setup#

Set callback function to get the authentication result.
After the authentication is complete, the token will be returned and used for GCCS functions.

setSuccessCallback(successCallback)

Example#

const gccs = new Guardian();gccs.setSuccessCallback((token) => {  console.log('token : ' + token);});

onSuccess#

NameTypeDescription
tokenStringToken