CINXE.COM

Login - KG Media ID

<div class="container container-back"> <a href="https://travel.kompas.com/read/2017/04/25/060300827/mencicipi.swike.purwodadi.sup.kodok.dengan.tauco" class="block-back"> <span class="icon icon-back"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/icon-back.png" alt="" width="20" height="20"></span> Kembali ke Kompas.com </a> </div> <!DOCTYPE html> <html lang="en"> <head> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-PT7PC4');</script> <!-- End Google Tag Manager --> <script type="text/javascript"> (function(f,b){if(!b.__SV){var e,g,i,h;window.mixpanel=b;b._i=[];b.init=function(e,f,c){function g(a,d){var b=d.split(".");2==b.length&&(a=a[b[0]],d=b[1]);a[d]=function(){a.push([d].concat(Array.prototype.slice.call(arguments,0)))}}var a=b;"undefined"!==typeof c?a=b[c]=[]:c="mixpanel";a.people=a.people||[];a.toString=function(a){var d="mixpanel";"mixpanel"!==c&&(d+="."+c);a||(d+=" (stub)");return d};a.people.toString=function(){return a.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" "); for(h=0;h<i.length;h++)g(a,i[h]);var j="set set_once union unset remove delete".split(" ");a.get_group=function(){function b(c){d[c]=function(){call2_args=arguments;call2=[c].concat(Array.prototype.slice.call(call2_args,0));a.push([e,call2])}}for(var d={},e=["get_group"].concat(Array.prototype.slice.call(arguments,0)),c=0;c<j.length;c++)b(j[c]);return d};b._i.push([e,f,c])};b.__SV=1.2;e=f.createElement("script");e.type="text/javascript";e.async=!0;e.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL? MIXPANEL_CUSTOM_LIB_URL:"file:"===f.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";g=f.getElementsByTagName("script")[0];g.parentNode.insertBefore(e,g)}})(document,window.mixpanel||[]); // Enabling the debug mode flag is useful during implementation, // but it's recommended you remove it for production mixpanel.init('a23050fa03288a8181f2681419e7815b', {debug: true}); </script> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width"> <meta name="description" content="User login page" /> <!-- url bar color theme --> <meta name="theme-color" content="#fff"> <meta name="msapplication-navbutton-color" content="#fff"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="theme-color" content="#fff"> <meta name="msapplication-navbutton-color" content="#fff"> <meta name="apple-mobile-web-app-status-bar-style" content="#fff"> <style type="text/css"> div#appleid-signin { cursor: pointer; } .g_id_signin { display: none; } </style> <!-- icon --> <link rel="shortcut icon" href="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/favicon.ico"> <title>Login - KG Media ID</title> <!-- font --> <link rel="preload" href="https://fonts.gstatic.com/s/roboto/v19/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2" as="font" type="font/woff2" crossorigin="anonymous"> <link rel="preload" href="https://fonts.gstatic.com/s/roboto/v19/KFOlCnqEu92Fr1MmWUlfBBc4AMP6lQ.woff2" as="font" type="font/woff2" crossorigin="anonymous"> <style> @font-face { font-family: 'Roboto'; font-display: swap; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v19/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { font-family: 'Roboto'; font-display: swap; font-style: normal; font-weight: 700; src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v19/KFOlCnqEu92Fr1MmWUlfBBc4AMP6lQ.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } </style> <link href="https://asset.kompas.com/data/2020/widget/ssonew/asset/css/style-m.min.css?v=12" rel="stylesheet" type="text/css"> <!-- <link href="https://asset.kompas.com/data/2020/widget/ssonew/asset/css/style-m-dev.min.css?v=12" rel="stylesheet" type="text/css"> --> <meta name="google-signin-client_id" content="776828813358-infk4sje3q07sa8mg8n6lq1mk2pdkkua.apps.googleusercontent.com"> </head> <body> <!-- Google Tag Manager --> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-PT7PC4" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager --> <!-- layout --> <div class="container"> <script> window.googletag = window.googletag || { cmd: [] }; window.googletag.cmd.push(function () { window.googletag.secureSignalProviders = window.googletag.secureSignalProviders || []; window.googletag.secureSignalProviders.clearAllCache(); }); </script> <div class="block-top"> <h1 class="title">KG Media ID</h1> <p class="custom_text">Login dengan KG Media ID untuk menggunakan layanan-layanan dari KG Media.</p> </div> <div class="block-middle"> <div class="form-main"> <form method="POST" action="https://account.kompas.com/signin" accept-charset="UTF-8"><input name="_token" type="hidden" value="QkvdLlJQYvk2yAMQenmUWPan5PY3U5RiLoRgxedi"> <div class="form-row form-input"> <label for="email">KG Media ID</label> <input id="email" class="" placeholder="email" name="email" type="email"> </div> <div class="form-row form-input"> <label for="password">Password</label> <input id="password" class=" js-viewTxt" placeholder="" name="password" type="password" value=""> <button type="button" class="form-view icon-view js-view"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/icon-view.png" alt="view"></button> </div> <input id="device" name="device" type="hidden" value="web_desktop"> <input id="service" name="service" type="hidden" value="a29tcGFz"> <input id="continue" name="continue" type="hidden" value="aHR0cHM6Ly90cmF2ZWwua29tcGFzLmNvbS9yZWFkLzIwMTcvMDQvMjUvMDYwMzAwODI3L21lbmNpY2lwaS5zd2lrZS5wdXJ3b2RhZGkuc3VwLmtvZG9rLmRlbmdhbi50YXVjbw=="> <input id="continue_d" name="continue_d" type="hidden" value="https://travel.kompas.com/read/2017/04/25/060300827/mencicipi.swike.purwodadi.sup.kodok.dengan.tauco"> <input id="utm_source" name="utm_source" type="hidden" value=""> <input id="utm_medium" name="utm_medium" type="hidden" value=""> <input id="utm_campaign" name="utm_campaign" type="hidden" value=""> <hr> <div class="form-row"> <input type="submit" value="Login" class="button -primary"> </div> <div class="block-login"> <p> <a href="https://account.kompas.com/register/a29tcGFz/aHR0cHM6Ly90cmF2ZWwua29tcGFzLmNvbS9yZWFkLzIwMTcvMDQvMjUvMDYwMzAwODI3L21lbmNpY2lwaS5zd2lrZS5wdXJ3b2RhZGkuc3VwLmtvZG9rLmRlbmdhbi50YXVjbw==">Daftar KG Media ID?</a> atau <a href="https://account.kompas.com/forgot-password">lupa password?</a> </p> </div> </form> </div> <div class="form-hr"><span>atau</span></div> <div class="form-sosmed"> <div class="text-center"> <p>Login KG Media ID dengan akun ini</p> <hr> </div> <div class="form-row"> <!-- <div id="g_id_onload" data-context="signin" data-ux_mode="popup" data-auto_select="true" data-state_cookie_domain="kompas.com" data-client_id="776828813358-infk4sje3q07sa8mg8n6lq1mk2pdkkua.apps.googleusercontent.com" data-login_uri="https://account.kompas.com/social/user" data-provider="google" data-scope="public_profile,email,openid" data-cancel_on_tap_outside="false" data-service="a29tcGFz" data-_token="QkvdLlJQYvk2yAMQenmUWPan5PY3U5RiLoRgxedi" data-continue="aHR0cHM6Ly90cmF2ZWwua29tcGFzLmNvbS9yZWFkLzIwMTcvMDQvMjUvMDYwMzAwODI3L21lbmNpY2lwaS5zd2lrZS5wdXJ3b2RhZGkuc3VwLmtvZG9rLmRlbmdhbi50YXVjbw==" data-utm_source="" data-utm_medium="" data-utm_campaign="" > </div> <div class="g_id_signin" data-type="standard" data-shape="rectangular" data-theme="outline" data-text="signin_with" data-size="medium" data-auto_prompt="true" data-locale="id" data-logo_alignment="left" data-width="360"> </div> --> <div class="form-row"> <button class="my-awesome-button button -theme-google" onclick="handleGoogleLogin()"> <span class="icon icon-google"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/icon-google@2x.png" alt="google" onclick="handleGoogleLogin()"></span> Masuk dengan Google </button> <button class="my-awesome-button button -theme-google" id="googleLgnBtn" style="display:none;"></button> </div> </div> <div class="form-row"> <a href="javascript:void(0)" class="button -theme-facebook" id="facebook_login"><span class="icon icon-facebook"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/icon-facebook@2x.png" alt="facebook"></span> Masuk dengan Facebook</a> </div> <!-- <div class="form-row"> <a href="" class="button -theme-apple"><span class="icon icon-apple"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/icon-apple@2x.png" alt="apple"></span> Masuk dengan Apple</a> </div> --> <div class="form-row"> <!-- <a href="https://auth.myvalue.id/authorize/?client_id=KGMedia&redirect_uri=https://sso.kompas.com/signin_myvalue&state=a29tcGFz aHR0cHM6Ly90cmF2ZWwua29tcGFzLmNvbS9yZWFkLzIwMTcvMDQvMjUvMDYwMzAwODI3L21lbmNpY2lwaS5zd2lrZS5wdXJ3b2RhZGkuc3VwLmtvZG9rLmRlbmdhbi50YXVjbw==" class="button -theme-myvalue"><span class="icon icon-myvalue"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/icon-myvalue@2x.png" alt="myvalue"></span> Masuk dengan MyValue</a> --> <a href="https://auth.myvalue.id/authorize/?client_id=KGMedia&redirect_uri=https://account.kompas.com/signin_myvalue&state=a29tcGFz aHR0cHM6Ly90cmF2ZWwua29tcGFzLmNvbS9yZWFkLzIwMTcvMDQvMjUvMDYwMzAwODI3L21lbmNpY2lwaS5zd2lrZS5wdXJ3b2RhZGkuc3VwLmtvZG9rLmRlbmdhbi50YXVjbw==" class="button -theme-myvalue"><span class="icon icon-myvalue"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/icon-myvalue@2x.png" alt="myvalue"></span> Masuk dengan MyValue</a> </div> <div class="form-row"> <div id="appleid-signin" class="signin-button" data-color="black" data-border="4" data-height="32" data-type="sign-in" data-mode="left-align" data-logo-size="medium"></div> </div> </div> <!-- <div id="g_id_onload" data-client_id="776828813358-infk4sje3q07sa8mg8n6lq1mk2pdkkua.apps.googleusercontent.com" data-auto_select="true" data-state_cookie_domain="kompas.com" data-itp_support="true" data-login_uri="https://account.kompas.com/social/user" data-provider="google" data-scope="public_profile,email,openid" data-cancel_on_tap_outside="false" data-service="a29tcGFz" data-_token="QkvdLlJQYvk2yAMQenmUWPan5PY3U5RiLoRgxedi" data-continue="aHR0cHM6Ly90cmF2ZWwua29tcGFzLmNvbS9yZWFkLzIwMTcvMDQvMjUvMDYwMzAwODI3L21lbmNpY2lwaS5zd2lrZS5wdXJ3b2RhZGkuc3VwLmtvZG9rLmRlbmdhbi50YXVjbw==" data-utm_source="" data-utm_medium="" data-utm_campaign=""> </div> --> <!-- data-callback="onSuccess" --> </div> <div class="block-footer"> <div class="block-info"><span class="termcondition">Dengan login di KGMedia ID, kamu menyetujui bahwa data dan informasi KG Media ID milikmu akan digunakan untuk memberikan layanan sesuai</span> <a href="https://www.kgmedia.id/legal-privacy-id" target="_blank">Kebijakan Data Pribadi KG Media</a> . </div> <div class="block-network"> <p>KG Media ID dapat digunakan di layanan-layanan berikut</p> <div class="network"> <div class="network-item"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/logo-kompascom.png?v=1" alt="Kompas.com"></div> <div class="network-item"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/logo-grid.png?v=1" alt="Grid"></div> <div class="network-item"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/logo-tribunnews.png?v=1" alt="Tribunnews"></div> <div class="network-item"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/logo-kompastv.png?v=1" alt="Kompasc TV"></div> <div class="network-item"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/logo-kompasiana.png?v=1" alt="Kompasiana"></div> <div class="network-item"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/logo-sonora.png?v=1" alt="Sonora"></div> <div class="network-item"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/logo-motorplus.png?v=1" alt="Motorplus"></div> <div class="network-item"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/logo-gridoto.png?v=1" alt="Gridoto"></div> <div class="network-item"><img src="https://asset.kompas.com/data/2020/widget/ssonew/asset/images/logo-bolasport.png?v=1" alt="Bolasport"></div> </div> </div> </div> <script> const al = 0; if(al){ setTimeout(function() { window.location.href = 'https://travel.kompas.com/read/2017/04/25/060300827/mencicipi.swike.purwodadi.sup.kodok.dengan.tauco'; }, 2000); } </script> </div> <script type="text/javascript" src="https://asset.kompas.com/data/2020/widget/ssonew/asset/js/main.min.js?v=1"></script> <script type="text/javascript" src="https://asset.kompas.com/data/2020/widget/ssonew/asset/js/sideload.min.js?v=2"></script> <script type="text/javascript" src="https://asset.kompas.com/data/2020/widget/ssonew/asset/js/ssouser.min.js"></script> <script type="text/javascript"> window.jQuery || document.write("<script src='https://asset.kompas.com/data/2020/widget/ssonew/asset/js/jquery.js'>"+"<"+"/script>"); </script> <script src='https://www.google.com/recaptcha/api.js'></script> <script src="https://accounts.google.com/gsi/client" async defer></script> <script type="text/javascript"> var sso_url = "https://"+window.location.hostname+"/"; </script> <script type="text/javascript"> if('ontouchstart' in document.documentElement) document.write("<script src='https://asset.kompas.com/data/2020/widget/ssonew/asset/js/jquery.mobile.custom.js'>"+"<"+"/script>"); </script> <script> function setCookieAL3(name,value,time) { var expires = ""; var domain = document.domain.split('.').reverse().splice(0,2).reverse().join('.'); if (time) { var date = new Date(); date.setTime(date.getTime() + time); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; domain=."+domain+"; path=/; SameSite=None; Secure"; } const avail = ["plus-staging.kompas.com" , "plus.kompas.com", "vik-staging.kompas.com"]; let cont_url = $("#continue_d").val(); if(cont_url != undefined){ cont_url = cont_url.split("/")[2]; } let ch_ot = 1; var url = new URL(window.location.href); var get_l = url.searchParams.get("l"); get_l = (get_l !== null && get_l == "c") ? false : true; var ch_fcm = getCookie('ch_fcm'); if(get_l == false){ if(ch_fcm == null){ setCookieAL3('ch_fcm', 'false', 2 * 60 * 60 * 1000); } } else{ if(ch_fcm !== null){ get_l = false; } } function handleCredentialResponse(response) { service = $("#service").val(); continue_url = $("#continue").val(); utm_source = $("#utm_source").val(); utm_medium = $("#utm_medium").val(); utm_campaign = $("#utm_campaign").val(); // $.ajaxSetup({ // headers: { // 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') // } // }); // if(avail.includes(cont_url)){ // param_google = { // provider:'google', // domain:"kompas.com", // credential: response.access_token, // 'service': service, // 'continue': continue_url, // 'utm_source': utm_source, // 'utm_medium': utm_medium, // 'utm_campaign': utm_campaign, // 'at' : true // }; // } else{ // param_google = { // provider:'google', // domain:"kompas.com", // credential: response.credential, // 'service': service, // 'continue': continue_url, // 'utm_source': utm_source, // 'utm_medium': utm_medium, // 'utm_campaign': utm_campaign // }; // } // $.ajax({ // type: "POST", // url: sso_url + 'social/without-redirect', // data: param_google, // dataType: "json", // success: function(result){ // create_sso_cookie(result); // } // }); if(avail.includes(cont_url)){ $.redirect(sso_url + 'social/user', {provider:'google', credential: response.access_token, 'service': service, 'continue': continue_url, 'utm_source': utm_source, 'utm_medium': utm_medium, 'utm_campaign': utm_campaign, 'at' : true}); } else{ $.redirect(sso_url + 'social/user', {provider:'google', credential: response.credential, 'service': service, 'continue': continue_url, 'utm_source': utm_source, 'utm_medium': utm_medium, 'utm_campaign': utm_campaign}); } } if(avail.includes(cont_url)){ var client; var access_token; ch_ot = 0; function initClient() { client = google.accounts.oauth2.initTokenClient({ client_id: "776828813358-infk4sje3q07sa8mg8n6lq1mk2pdkkua.apps.googleusercontent.com", scope: 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile', auto_select: get_l, cancel_on_tap_outside: false, _token: "QkvdLlJQYvk2yAMQenmUWPan5PY3U5RiLoRgxedi", state_cookie_domain: "kompas.com", callback: handleCredentialResponse, use_fedcm_for_prompt: true // callback: (tokenResponse) => { // access_token = tokenResponse.access_token; // }, }); } } window.onload = function () { google.accounts.id.initialize({ client_id: "776828813358-infk4sje3q07sa8mg8n6lq1mk2pdkkua.apps.googleusercontent.com", callback: handleCredentialResponse, auto_select: get_l, cancel_on_tap_outside: false, _token: "QkvdLlJQYvk2yAMQenmUWPan5PY3U5RiLoRgxedi", state_cookie_domain: "kompas.com", use_fedcm_for_prompt: true }); var pathArray = window.location.pathname.split('/'); if (document.cookie.indexOf('XKMPSS=') == -1 && ch_ot == 1 && (pathArray[1] == "login")) { google.accounts.id.prompt(); // also display the One Tap dialog } google.accounts.id.renderButton(document.getElementById("googleLgnBtn"), { theme: 'outline', size: 'large', click_listener: onClickHandler }); function onClickHandler(){ console.log("Sign in with Google button clicked...") } } function handleGoogleLogin(){ if(avail.includes(cont_url)){ client.requestAccessToken(); } else{ document.querySelector('#googleLgnBtn div div div').click(); } } function ssoLogout(revoke){ google.accounts.id.disableAutoSelect(); delete_cookie('kmp_uid'); delete_cookie('kmp_lgn'); delete_cookie('kmps_usrid'); delete_cookie('ukid'); delete_cookie('kmp_nm'); delete_cookie('lgn_w',); delete_cookie('XKMPSS'); window.location.reload() } </script> <script> function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } } return decodeURI(dc.substring(begin + prefix.length, end)); } function setCookieAL(name,value,days) { var expires = ""; var domain = document.domain; if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; path=/; SameSite=None; Secure"; } function setCookieAL2(name,value,days) { var expires = ""; var domain = document.domain.split('.').reverse().splice(0,2).reverse().join('.'); if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; domain=."+domain+"; path=/; SameSite=None; Secure"; } function delete_cookie(name) { var expires = ""; var domain = document.domain; var value = 'empty'; var date = new Date(); date.setTime(date.getTime() + (1*1000)); expires = "; expires=Thu, 01 Jan 1970 00:00:00 GMT"; // Expires=Thu, 01 Jan 1970 00:00:01 GMT;' document.cookie = name + "=" + (value || "") + expires + "; path=/; SameSite=None; Secure"; } delete_cookie('g_state'); var url = new URL(window.location.href); var l = url.searchParams.get("l"); if(l == "c"){ var date = new Date(); set_get_g_state = JSON.parse('{"i_l":0, "i_t":'+date.setTime(date.getTime() + (2 * 24 * 60 * 60 * 1000))+'}'); // setCookieAL('g_state', JSON.stringify(set_get_g_state), 180); setCookieAL2('g_state', JSON.stringify(set_get_g_state), 180); } if(getCookie('g_state')){ var get_g_state = JSON.parse(getCookie('g_state')); var result_g_state = {}; $.each(get_g_state, function (index, value) { if(index == "i_p" || index == "i_t"){ diff = Math.floor((value - Date.now()) / 1000); if(diff > (2 * 24 * 60 * 60 * 1000)){ value = (Date.now() + (2 * 24 * 60 * 60 * 1000)); } } result_g_state[index] = value; }); // setCookieAL('g_state', JSON.stringify(result_g_state), 180); setCookieAL2('g_state', JSON.stringify(result_g_state), 180); } </script> <!-- inline scripts related to this page --> <script type="text/javascript"> // const button = document.getElementById('signout_button'); // button.onclick = () => { // google.accounts.id.disableAutoSelect(); // } jQuery(function($) { $(document).on('click', '.toolbar a[data-target]', function(e) { e.preventDefault(); var target = $(this).data('target'); $('.widget-box.visible').removeClass('visible');//hide others $(target).addClass('visible');//show target }); //js for term $('.close-btn').click(function(event) { $('.box-in').hide(); }); $('#setting_pass').click(function(e){ e.preventDefault(); $('#messages').show(); $('#home').hide(); $('.li1').removeClass('active'); $('.li2').addClass('active'); }); $('#setting_profile').click(function(e){ e.preventDefault(); $('#messages').hide(); $('#home').show(); $('.li2').removeClass('active'); $('.li1').addClass('active'); }); }); $(document).ready(function() { function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } } return decodeURI(dc.substring(begin + prefix.length, end)); } }); </script> <!-- DOM UNTUK PROVINSI DAN KOTA --> <script type="text/javascript" src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"></script> <script type="text/javascript"> service = $("#service").val(); continue_url = $("#continue").val(); utm_source = $("#utm_source").val(); utm_medium = $("#utm_medium").val(); utm_campaign = $("#utm_campaign").val(); var state = 'appleid&'+service+'&'+continue_url+'&'+utm_source+'&'+utm_medium+'&'+utm_campaign; AppleID.auth.init({ // clientId : 'test.login.appleid', clientId : 'com.kompas.sso', scope : 'name email', redirectURI: sso_url + 'social/user', // redirectURI: sso_url + 'login-apple-id', state : state, usePopup : true }); // Listen for authorization success. document.addEventListener('AppleIDSignInOnSuccess', (event) => { service = $("#service").val(); continue_url = $("#continue").val(); utm_source = $("#utm_source").val(); utm_medium = $("#utm_medium").val(); utm_campaign = $("#utm_campaign").val(); id_token = event.detail.authorization.id_token; try { user = JSON.stringify(event.detail.user) } catch { user = JSON.stringify({}); } // console.log(event); // console.log(event.detail.user); // console.log(event.detail.data); // console.log(user); // return false; // $.ajaxSetup({ // headers: { // 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') // } // }); // param_google = { // provider:'appleid', // 'service': service, // 'user': user, // 'continue': continue_url, // 'utm_source': utm_source, // 'utm_medium': utm_medium, // 'utm_campaign': utm_campaign, // 'id_token': id_token, // }; // $.ajax({ // type: "POST", // url: sso_url + 'social/without-redirect', // data: param_google, // dataType: "json", // success: function(result){ // create_sso_cookie(result); // } // }); $.redirect(sso_url + 'social/user', {provider:'appleid','service': service, 'user':user, 'continue': continue_url, 'utm_source': utm_source, 'utm_medium': utm_medium, 'utm_campaign': utm_campaign, 'id_token': id_token}); // Handle successful response. }); // Listen for authorization failures. document.addEventListener('AppleIDSignInOnFailure', (event) => { // Handle error. console.log(event); console.log(event.detail.error); }); </script> <script src="https://apis.google.com/js/platform.js?onload=onLoadGoogleCallback" async defer></script> <script> var fbE = document.getElementById("facebook_login"); if(fbE){ document.getElementById('facebook_login').addEventListener('click', function() { //do the login FB.login((response) => { if (response.authResponse) { //user just authorized your app // document.getElementById('loginBtn').style.display = 'none'; getFbUserData(); } }, {scope: 'email,public_profile', return_scopes: true}); // FB.login(statusChangeCallback, {scope: 'email,public_profile', return_scopes: true}); }, false); } function checkLoginState() { FB.getLoginStatus(function(response) { // statusChangeCallback(response); getFbUserData(); }); } // Fetch the user profile data from facebook function getFbUserData(){ var access_token = FB.getAuthResponse()['accessToken']; // alert(access_token); FB.api('/me', {locale: 'en_US', fields: 'id,name,first_name,last_name,email,link,gender,picture'}, function (response) { saveUserData(response, access_token); }); } function saveUserData(userData, access_token){ service = $("#service").val(); continue_url = $("#continue").val(); // console.log(JSON.stringify(userData)); utm_source = $("#utm_source").val(); utm_medium = $("#utm_medium").val(); utm_campaign = $("#utm_campaign").val(); // $.ajaxSetup({ // headers: { // 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') // } // }); // param_google = { // provider:'facebook', // user: JSON.stringify(userData), // 'service': service, // 'continue': continue_url, // 'utm_source': utm_source, // 'utm_medium': utm_medium, // 'utm_campaign': utm_campaign, // 'id_token': access_token, // }; // $.ajax({ // type: "POST", // url: sso_url + 'social/without-redirect', // data: param_google, // dataType: "json", // success: function(result){ // create_sso_cookie(result); // } // }); $.redirect(sso_url+'social/user', {provider:'facebook', user: JSON.stringify(userData), 'service': service, 'continue': continue_url, 'id_token': access_token}); } window.fbAsyncInit = function() { FB.init({ // appId : '324557847592228', appId : '962955570527086', cookie : true, // enable cookies to allow the server to access xfbml : true, // parse social plugins on this page version : 'v2.8' // use graph api version 2.8 }); }; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <script src="https://apis.google.com/js/client:plusone.js" type="application/javascript"></script> <script> function onLoadGoogleCallback(){ gapi.load('auth2', function() { auth2 = gapi.auth2.init({ client_id: '776828813358-infk4sje3q07sa8mg8n6lq1mk2pdkkua.apps.googleusercontent.com', cookiepolicy: 'single_host_origin', scope: 'profile email' }); auth2.attachClickHandler(element, {}, function(googleUser) { // Retrieve the Google account data gapi.client.load('oauth2', 'v2', function () { var request = gapi.client.oauth2.userinfo.get({ 'userId': 'me' }); request.execute(function (resp) { gapi.auth2.getAuthInstance().signOut(); gapi.auth2.getAuthInstance().disconnect(); var id_token = googleUser.getAuthResponse().id_token; service = $("#service").val(); continue_url = $("#continue").val(); utm_source = $("#utm_source").val(); utm_medium = $("#utm_medium").val(); utm_campaign = $("#utm_campaign").val(); // $.ajaxSetup({ // headers: { // 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') // } // }); // param_google = { // provider:'google', // user: JSON.stringify(resp), // domain:"kompas.com", // 'service': service, // 'continue': continue_url, // 'utm_source': utm_source, // 'utm_medium': utm_medium, // 'utm_campaign': utm_campaign, // 'id_token': id_token, // }; // $.ajax({ // type: "POST", // url: sso_url + 'social/without-redirect', // data: param_google, // dataType: "json", // success: function(result){ // create_sso_cookie(result); // } // }); $.redirect(sso_url + 'social/user', {provider:'google', user: JSON.stringify(resp), 'service': service, 'continue': continue_url, 'utm_source': utm_source, 'utm_medium': utm_medium, 'utm_campaign': utm_campaign, 'id_token': id_token}); }); }); } ); }); element = document.getElementById('google_login'); } // Render Google Sign-in button function renderButton() { gapi.signin2.render('gSignIn', { 'scope': 'profile email', 'width': 300, 'height': 40, 'longtitle': true, 'theme': 'dark', 'onsuccess': onSuccess, 'onfailure': onFailure }); } // Sign-in success callback function onSuccess(googleUser) { // Retrieve the Google account data gapi.client.load('oauth2', 'v2', function () { var request = gapi.client.oauth2.userinfo.get({ 'userId': 'me' }); request.execute(function (resp) { gapi.auth2.getAuthInstance().signOut(); gapi.auth2.getAuthInstance().disconnect(); // alert('1'); service = $("#service").val(); continue_url = $("#continue").val(); utm_source = $("#utm_source").val(); utm_medium = $("#utm_medium").val(); utm_campaign = $("#utm_campaign").val(); // $.ajaxSetup({ // headers: { // 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') // } // }); // param_google = { // provider:'google', // user: JSON.stringify(resp), // domain:"kompas.com", // 'service': service, // 'continue': continue_url, // 'utm_source': utm_source, // 'utm_medium': utm_medium, // 'utm_campaign': utm_campaign, // }; // $.ajax({ // type: "POST", // url: sso_url + 'social/without-redirect', // data: param_google, // dataType: "json", // success: function(result){ // create_sso_cookie(result); // } // }); $.redirect(sso_url + 'social/user', {provider:'google', user: JSON.stringify(resp), 'service': service, 'continue': continue_url, 'utm_source': utm_source, 'utm_medium': utm_medium, 'utm_campaign': utm_campaign}); }); }); } // Sign-in failure callback function onFailure(error) { alert("Terjadi kesalahan. Coba beberapa saat lagi."); } // Sign out the user function signOut() { var auth2 = gapi.auth2.getAuthInstance(); auth2.signOut().then(function () { document.getElementsByClassName("userContent")[0].innerHTML = ''; document.getElementsByClassName("userContent")[0].style.display = "none"; document.getElementById("gSignIn").style.display = "block"; }); auth2.disconnect(); } window.onbeforeunload = function(e){ if(gapi.auth2.getAuthInstance() != ""){ gapi.auth2.getAuthInstance().signOut(); } }; function create_sso_cookie(result) { // setCookieAL2('kmp_uid',result.data.token,result.data.expire_at); // setCookieAL2('kmp_lgn','kompas',result.data.expire_at); // setCookieAL2('kmps_usrid',result.data.mykompas_id,result.data.expire_at); // setCookieAL2('ukid',result.data.old_mykompas_id,result.data.expire_at); // setCookieAL2('kmp_nm',result.data.fullname,result.data.expire_at); // setCookieAL2('first_name',result.data.first_name,result.data.expire_at); // setCookieAL2('kmp_pp',result.data.progress,result.data.expire_at); // setCookieAL2('lgn_w',result.data.login_with,result.data.expire_at); // setCookieAL2('XKMPSS',result.data.XKMPSS,result.data.expire_at); var hit_cookie_publisher = '<img src="'+result.data.endpoint_login+'" style="display:none"><img src="'+result.data.endpoint_acc_flow+'" style="display:none">'; document.getElementsByTagName("body")[0].insertAdjacentHTML("beforeend",hit_cookie_publisher) var cek_cookie = setInterval(function(){ var sso_login = getCookie("XKMPSS"); if (sso_login) { clearInterval(cek_cookie); window.location.reload(); } }, 200); } </script> <script src="https://cdn.jsdelivr.net/npm/jquery.redirect@1.1.1/jquery.redirect.min.js"></script> <script type="text/javascript" src="https://assets.kompas.com/data/2023/sso/js/sdk-cookie-consent-v2.js"></script> <!-- <script type="text/javascript" src="https://assets.kompas.com/data/2023/sso/js/cookie-consent-sdk.js"></script> --> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10