1. Copy and paste the next scripts before you ending body tag (</body>)

<script src="https://sso.tapit.com.co/v3/tapit.sso.main.js"></script> <script> function configTapitSso() { // ssoApp defined! ssoApp.configApp(CONFIG_OBJECT); } </script>

2. Create a configuration object like the next one and save it in a CONFIG_OBJECT=

3. Configure the sso through the api exposed via the ssoApp global object

<script> function configTapitSso() { ssoApp.configApp(CONFIG_OBJECT); } </script>

4. Show the sso calling the ssoApp.showApp('PAGE_NAME') method

<button onclick="ssoApp.showApp('sign-up')">SIGN UP</button>

5. See the available pages and the exposed methods

PAGES: ssoApp.showApp('signIn'); ssoApp.showApp('sign-up'); ssoApp.showApp('recover-password'); METHODS: ssoApp.configApp(config) ssoApp.showApp('page') ssoApp.hideApp() ssoApp.getCustomToken(userCredential).subscribe(customToken => console.log(customToken)) ssoApp.logout() OBJECTS: firestore (See docs here!) auth (See docs here!)

6. Authentication listener example

<script> function configTapitSso() { ssoApp.auth.onAuthStateChanged(function (userCredential) { if (userCredential) { console.log(userCredential); document.getElementById('current-user').innerText = JSON.stringify(userCredential); } }); } </script> (See auth docs here!)

7. Logout example

<button onclick="ssoApp.logout()">LOGOUT</button>

8. Firestore collection example

<script> function configTapitSso() { ssoApp.auth.onAuthStateChanged(function (userCredential) { if (userCredential) { ssoApp.firestore.collection('user_account_tap').doc(userCredential.uid).get() .then(function (document) { console.log(document.data()); }).catch(function (error) { console.log(error); }); } }); } </script> (See firestore docs here!)