<script src="https://alpha-myaccount.latam.coca-cola.com/sdk/v1.0.0/tcccLogin.js" async defer></script>
<script>
async () {
const sdk = await new tcccLogin.LoginSdk({
clientID: '648b793b-9fb8-******', // Please replace the value with actual clientId for your app.
tokenExchangeUrl: '/token_exchange.html'
})
await sdk.isSDKReady()
window.sdk = sdk
}
</script>
await window.sdk.getAuthenticationUrl(forceLogin, originClientId)window.sdk.getEditProfileUrl()window.sdk.getSignOutUrl()window.sdk.saveScrollPosition()
<script>
async () {
const sdk = await new tcccLogin.LoginSdk({ clientID: '648b793b-9fb8-******' })
await sdk.isSDKReady()
window.sdk = sdk
window.sdk.overrideCurrentPageOnCookie('https://www.example.com/test-success.html')
}
</script>window.sdk.isAuthenticated()window.sdk.isSDKReady().then(...) // or await window.sdk.isSDKReady()
await window.sdk.getAccountAuthenticationInfo(window.sdk.getOrigin())
{
"hasPassword": false,
"authenticationSource": "localAccountAuthentication",
"email": "user-email@test.com",
"currentUserIssuer": "https://gamma-login.latam.coca-cola.com/2f09d0bb-c222-4396-bc8f-ff45a268d36b/v2.0/",
"lastLinkedOrUnlinkedAccount": null,
"kocid": "965d22096f32639e518787858883ca9138cb3cf3b9af528563f7f3a4a7c323f4",
"country": "PE",
"given_name": "Test",
"socialUserIssuers": [
{
"issuer": "facebook.com",
"issuerUserId": "3630005700444447"
},
{
"issuer": "google.com",
"issuerUserId": "104040041357104144444"
}
]
}await window.sdk.getAuthHeader()
{
"accessToken": "..."
}
${env} = alpha|beta|gamma
${b2cTenantId} = B2C Tenant ID
${b2cPolicyName} = B2C_1A_SIGNUP_SIGNIN_GENERIC|B2C_1A_CHANGEPASSWORD_GENERIC|B2C_1A_CHANGEPHONE_GENERIC
const params = {
"authority": "https://${env}-login.latam.coca-cola.com/${b2cTenantId}/${b2cPolicyName}",
"extraQueryParameters": {
"isWebBrowser": true
"country": "MX",
"campaign": "CCETH"
}
}
await window.sdk.doRedirect(params)
await window.sdk.doLogout()
const response = await window.sdk.createAuthRequest({
method: 'GET',
domain: 'https://frontend.${env}.latam.gcds.coke.com/v2',
endPoint: '/members'
})
// or
window.sdk.createAuthRequest({
method: 'GET',
domain: 'https://frontend.${env}.latam.gcds.coke.com/v2',
endPoint: '/members'
})
.then((response) => console.log(response))
.catch((error) => console.log(error))await window.sdk.getOrigin()await window.sdk.loadAuthPage()window.sdk.readCookie('cds-current-user-token')