This feed does not validate.
<div class="container container-back">
... ck.png" alt="" width="20" height="20"></span>
^
In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendation.
help]
[<div class="container container-back">
<a href="https://mujigja.co.kr/" 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 Kompasiana.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-P7HQ38');</script>
<!-- End Google Tag Manager -->
<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="757762616873-vt140ml7alfp8ocoeqsnhjrsilugjnll.apps.googleusercontent.com">
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P7HQ38" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<!-- 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.kompasiana.com/signin" accept-charset="UTF-8"><input name="_token" type="hidden" value="kG8CrJZqgyjkEV3ynLT85btHtSB3C6T4fBYTn0ra">
<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="a29tcGFzaWFuYQ==">
<input id="continue" name="continue" type="hidden" value="aHR0cHM6Ly9tdWppZ2phLmNvLmtyLw==">
<input id="continue_d" name="continue_d" type="hidden" value="https://mujigja.co.kr/">
<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.kompasiana.com/register/a29tcGFzaWFuYQ==/aHR0cHM6Ly9tdWppZ2phLmNvLmtyLw==">Daftar KG Media ID?</a>
atau
<a href="https://account.kompasiana.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="kompasiana.com"
data-client_id="757762616873-vt140ml7alfp8ocoeqsnhjrsilugjnll.apps.googleusercontent.com"
data-login_uri="https://account.kompasiana.com/social/user"
data-provider="google"
data-scope="public_profile,email,openid"
data-cancel_on_tap_outside="false"
data-service="a29tcGFzaWFuYQ=="
data-_token="kG8CrJZqgyjkEV3ynLT85btHtSB3C6T4fBYTn0ra"
data-continue="aHR0cHM6Ly9tdWppZ2phLmNvLmtyLw=="
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=a29tcGFzaWFuYQ== aHR0cHM6Ly9tdWppZ2phLmNvLmtyLw==" 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.kompasiana.com/signin_myvalue&state=a29tcGFzaWFuYQ== aHR0cHM6Ly9tdWppZ2phLmNvLmtyLw==" 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="757762616873-vt140ml7alfp8ocoeqsnhjrsilugjnll.apps.googleusercontent.com" data-auto_select="true" data-state_cookie_domain="kompasiana.com" data-itp_support="true" data-login_uri="https://account.kompasiana.com/social/user" data-provider="google" data-scope="public_profile,email,openid" data-cancel_on_tap_outside="false" data-service="a29tcGFzaWFuYQ==" data-_token="kG8CrJZqgyjkEV3ynLT85btHtSB3C6T4fBYTn0ra" data-continue="aHR0cHM6Ly9tdWppZ2phLmNvLmtyLw==" 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://mujigja.co.kr/';
}, 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:"kompasiana.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:"kompasiana.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: "757762616873-vt140ml7alfp8ocoeqsnhjrsilugjnll.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: "kG8CrJZqgyjkEV3ynLT85btHtSB3C6T4fBYTn0ra",
state_cookie_domain: "kompasiana.com",
callback: handleCredentialResponse,
use_fedcm_for_prompt: true
// callback: (tokenResponse) => {
// access_token = tokenResponse.access_token;
// },
});
}
}
window.onload = function () {
google.accounts.id.initialize({
client_id: "757762616873-vt140ml7alfp8ocoeqsnhjrsilugjnll.apps.googleusercontent.com",
callback: handleCredentialResponse,
auto_select: get_l,
cancel_on_tap_outside: false,
_token: "kG8CrJZqgyjkEV3ynLT85btHtSB3C6T4fBYTn0ra",
state_cookie_domain: "kompasiana.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 src="https://cdn.myopenpass.com/openpass-js-sdk/v4/openpass-js-sdk.min.js"></script>
<script type="text/javascript">
window.addEventListener("DOMContentLoaded", async () => {
const openPassClient = new openpass.OpenPassClient({
clientId: "a162fd8860824dc4b7bab62db6866ee2"
});
openPassClient.renderSignInButton({
parentContainerElementId: "button-openpass",
authenticationMode: "popup",
redirectUrl: sso_url+"auth/openpass",
text: "signin_with",
shapeVariant: "rectangle",
size: 'medium',
popupSuccessCallback: (response) => {
// access the user's email address from the response
// console.log(response);
// console.log(response.idToken.email);
param_openpass = {
'provider':'openpass',
'credential': response.accessToken,
'service': service,
'domain':"kompasiana.com",
'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_openpass,
dataType: "json",
success: function(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);
window.location.href = "?lgn_method=openpass";
}
});
// and then redirect the user back to the original content.
// window.location = signInResponse.originatingUri;
},
popupFailedCallback: (error) => {
// log the error
console.error(JSON.stringify(error));
// Decide what to do if the sign-in fails (for example, the user closes the popup before authenticating):
// window.location = "/login";
}
});
});
</script>
<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: '757762616873-vt140ml7alfp8ocoeqsnhjrsilugjnll.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:"kompasiana.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:"kompasiana.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>