You are on page 1of 8

<!

DOCTYPE html>
<html lang="en">

<head>
<title>Nền tảng học trực tuyến mở đại trà (One Touch) | Đăng nhập</title>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-


fit=no" />
<link rel="icon" type="image/x-icon"
href="https://100627a33c4.vws.vegacdn.vn/netviet//home_page/assets/images/
identity/FaviconOnetouch.png" />

<link rel="stylesheet"
href="http://onetouch.mic.gov.vn/assets/library/bootstrap4/css/bootstrap.min.css" /
>
<!-- fontawesome5 -->
<link rel="stylesheet"
href="http://onetouch.mic.gov.vn/assets/library/fontawesome5/css/all.css" />
<!-- owl carousel -->
<link rel="stylesheet"
href="http://onetouch.mic.gov.vn/assets/library/owlcarousel/assets/
owl.carousel.min.css" />
<link rel="stylesheet"
href="http://onetouch.mic.gov.vn/assets/library/owlcarousel/assets/
owl.theme.default.min.css" />

<link rel="stylesheet" href="/css/all.css?id=b70d1e1fb43bb22facdf017ebba52b00">


<link rel="stylesheet"
href="http://onetouch.mic.gov.vn/assets/plugin/pnotify/pnotify.custom.min.css">

<style>
@media (min-width: 992px) {
.--border-left {
border-left: 1px solid #dee2e6;
}
}

.login-with a:hover {
background-color: var(--color);
color: #fff !important;
}
</style>
</head>

<body>
<main>
<section class="container-fluid signing-page">
<div class="row p-0 login-container">
<div class="my-auto col-12 col-xl-7 col-md-8 mx-auto">
<a href="http://onetouch.mic.gov.vn"><img

src="https://100627a33c4.vws.vegacdn.vn/netviet//home_page/assets/images/identity/
LogoOnetouch-side.png"
class="d-none d-lg-block mb-5" alt="" /></a>
<a href="http://onetouch.mic.gov.vn"><img

src="https://100627a33c4.vws.vegacdn.vn/netviet//home_page/assets/images/identity/
LogoOnetouch.png"
class="d-block d-lg-none mx-auto mt-5 mb-3" alt=""
/></a>
<div class="">

<form id="frmLogin"
old-url="https://onetouch.mic.gov.vn/dang-nhap"
action="http://onetouch.mic.gov.vn/dang-nhap"
class="login-form" method="POST">
<input type="hidden" name="_token"
value="UqHxD03uD4iRbBGssmdSBeZSR3pc2ddYSXoYAzV0">
<div class="row">
<div class="col-lg-7 pr-lg-5">
<h2
class="text-custom-primary mb-lg-5 mb-3
text-center text-md-left font-weight-bold">
Đăng
nhập</h2>
<div id="error_general"></div>
<label id="email-error" class="error"
for="email"></label>
<div class="form-group d-flex align-items-
center">
<i class="fas fa-phone input-icon text-
center"></i>
<input placeholder="Nhập số điện thoại hoặc
email" type="text" id="email"
name="email" class="input-custom-1"
autofocus />
</div>
<label id="password-error" class="error"
for="password"></label>
<div class="form-group d-flex align-items-
center">
<i class="fas fa-lock-alt input-icon text-
center"></i>
<input placeholder="Nhập mật khẩu"
type="password" id="password"
name="password" required class="input-
custom-1 password-input" autofocus />
<a href="" class="btn-check-password">
<i class="fas fa-eye"></i>
</a>
</div>

<div class="d-flex justify-content-between">


<div class="form-check">
<input name="remember_me"
type="checkbox"
class="form-check-input text-
custom-muted" id="check-input" />
<label class="mx-3 my-auto text-custom-
muted font-medium"
for="check-input">Ghi
nhớ
tôi</label>
</div>
<a href="http://onetouch.mic.gov.vn/quen-
mat-khau"
class="text-custom-info font-
medium">Quên mật
khẩu?</a>
</div>
<button class="btn btn-custom-1 py-3 col mt-lg-
5 mt-3">
Đăng nhập
</button>
<span
class="d-flex justify-content-center
font-medium text-custom-muted mt-4">Chưa
có tài khoản?</span>
<span class="d-flex justify-content-center
font-medium text-custom-muted">
<a
href="http://onetouch.mic.gov.vn/dang-ky" class="text-custom-primary mx-1">Đăng ký
</a> với Onetouch ngay</span>
</div>
<div class="col-lg-5 pl-lg-5 --border-left">
<h5 class="text-custom-primary text-center
text-lg-left font-weight-bold mb-lg-5"
style="padding-top: 14px">
Đăng nhập với
</h5>
<div class="font-medium text-custom-muted
login-with">
<a
href="http://onetouch.mic.gov.vn/facebook/auth"
style="--color: #1877f2;margin-top: 0px
!important;border:1px solid #1877f2; color: #1877f2;padding: 12px;border-
radius:6px;"
class="d-flex align-items-center mb-3">
<i class="fab fa-facebook-f fa-fw"></i>
<p class="w-100 text-center mb-
0">Facebook</p>
</a>
<a
href="http://onetouch.mic.gov.vn/auth/google"
style="--color: #C84130; margin-top:
0px !important;border:1px solid #C84130;color: #C84130;padding: 12px;border-
radius:6px;"
class="d-flex align-items-center mb-3">
<i class="fab fa-google"></i>
<p class="w-100 text-center mb-
0">Google</p>
</a>
<a href="javascript:void(0)"
style="--color:#ff8907;margin-top:
0px !important;border:1px solid #ff8907; color: #ff8907;padding: 12px;border-
radius:6px;"
class="d-flex align-items-center js-
login">
<i class="fas fa-key"></i>
<p class="w-100 text-center mb-
0">SSO</p>
</a>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="col-md-5 col-lg-3 p-0 ml-auto d-none d-lg-block login-
banner-right">
<img
src="https://100627a33c4.vws.vegacdn.vn/netviet//home_page/assets/images/banner/
login_banner.png" class=""
alt="" />
</div>
</div>
<script src="http://onetouch.mic.gov.vn/js/oidc-client-js/dist/oidc-
client.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
var settings = {
userStore: new Oidc.WebStorageStateStore({ store: window.localStorage }),
// URL of your OpenID Connect server.
// The library uses it to access the metadata document
authority: 'https://beta-sso.mic.gov.vn',
client_id: 'AitaClient',
redirect_uri: 'https://onetouch.mic.gov.vn/callback',
silent_redirect_uri: 'https://onetouch.mic.gov.vn/silent-renew',
post_logout_redirect_uri: 'https://onetouch.mic.gov.vn/index.html',
// What you expect back from The IdP.
// In that case, like for all JS-based applications, an identity token
// and an access token
response_type: 'code',
// Scopes requested during the authorisation request
scope: 'openid profile email offline_access u.api',
// Number of seconds before the token expires to trigger
// the `tokenExpiring` event
// Do we want to renew the access token automatically when it's
// about to expire?
automaticSilentRenew: true,
// Do we want to filter OIDC protocal-specific claims from the response?
filterProtocolClaims: true,
loadUserInfo: true
};
var manager = new Oidc.UserManager(settings);

var user;
Oidc.Log.logger = console;
manager.events.addUserLoaded(function (loadedUser) {
user = loadedUser;
console.log(user);
var data = { "access_token": user.access_token, "profile": user.profile };
postDataUser(data);
});
manager.events.addSilentRenewError(function (error) {
console.error('error while renewing the access token', error);
});
manager.events.addUserSignedOut(function () {
alert('The user has signed out');
});
$('.js-login').on('click', function () {
manager.signinRedirect()
.catch(function (error) {
console.error('error while logging in through the popup', error);
});
});

$(document).on('click', '#js-logout', function(e) {


e.preventDefault();
manager.getUser().then(user => {
var is_sso_login = window.localStorage.getItem('is_sso_login');
if (user || is_sso_login) {
manager.signoutRedirect();
} else {
window.location.href = 'http://onetouch.mic.gov.vn/dang-xuat';
}
});
});

if (document.referrer.includes('aisdwp.mic.gov.vn')) {
manager.createSigninRequest().then(function(req) {
window.localStorage.setItem('is_sso_login', true);
window.location = req.url;
});
}

function postDataUser(data){
$.ajax({
url: 'http://onetouch.mic.gov.vn/ajax/post-user-with-sso',
method: 'post',
data: data,
dataType: "json",
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-
token"]').attr('content')},
success: function(data){
if(data.rs){
window.location.href = 'http://onetouch.mic.gov.vn';
}
}
})
}
</script>
</section>
</main>
<script
src="http://onetouch.mic.gov.vn/assets/library/jquery/jquery.min.js"></script>
<script
src="http://onetouch.mic.gov.vn/assets/library/bootstrap4/js/bootstrap.min.js"></
script>
<script
src="http://onetouch.mic.gov.vn/assets/library/owlcarousel/owl.carousel.js"></
script>
<script src="http://onetouch.mic.gov.vn/assets/js/jquery.validate.min.js"></
script>
<script
src="http://onetouch.mic.gov.vn/assets/plugin/pnotify/pnotify.custom.min.js"></
script>

<!-- Optional JavaScript -->


<script src="/js/app.js?id=d3e6608cd368b4430ec61d0dcb8f0667"></script>
<script src="https://www.google.com/recaptcha/api.js?
render=6LeOynQnAAAAACuvcGGcvKe2fwEA_O6_IpuZWJry"></script>
<script>
$(document).ready(function() {
$('#frmLogin').validate({
ignore: ".ignore",
rules: {
email: "required",
password: "required"
},
messages: {
email: "Tài khoản không hợp lệ",
password: "Mật khẩu không hợp lệ",
},
submitHandler: function(form) {
grecaptcha.ready(function() {

grecaptcha.execute("6LeOynQnAAAAACuvcGGcvKe2fwEA_O6_IpuZWJry", {
action: 'submit'
}).then(function(token) {
let input = document.createElement('input');
input.type = 'hidden';
input.name = 'g-captcha';
input.value = token;
form.appendChild(input);
var data = $
(form).serializeArray();
var url = $(form).attr('action'); request_ajax(url,
data,
"POST",
function(res) {
if (res.rs == 0) {
$.each(res.errors, function(key, msg) {
$('#' + key + '-error').html(msg)
.show();
});
} else if (res.rs == 1) {
$("#error_general").html(`<div
class="alert alert-danger alert-dismissible fade show" role="alert">
<span>` + res.msg +
`</span>
<button type="button"
class="close" data-dismiss="alert" aria-label="Close">
<span aria-
hidden="true">&times;</span>
</button>
</div>`);
} else if (res.rs == 4) {
$("#error_general").html(`<div
class="alert alert-danger alert-dismissible fade show" role="alert">
<span>` + res.msg + `
<a href="http://onetouch.mic.gov.vn/xac-nhan-email">Vui lòng click vào đây để tiến
hành xác nhận email</a></span>
<button type="button"
class="close" data-dismiss="alert" aria-label="Close">
<span aria-
hidden="true">&times;</span>
</button>
</div>`);
} else {
window.location = getReturnUrl();
}
});
return false;
})
})
}
});
})

function getReturnUrl() {
var queryString = window.location.search;

var urlParams = new URLSearchParams(queryString);


var returnUrl = urlParams.get('return_url');
if (returnUrl) {
return returnUrl;
}
return '/';
}

function ajax_loading(show) {
if ($('#bg-load').length == 0) {
$('body').append(
'<div id="bg-load" class="wrap-loader"><div id="container"><div
id="loader" class="loader"></div></div></div>'
);
}
if (show) {
$('#bg-load').show();
} else {
$('#bg-load').hide();
}
}

function request_ajax(url, data, method, done_callback) {


ajax_loading(true);
$.ajax({
method: method,
url: url,
dataType: 'json',
data: data
})
.done(function(res) {
ajax_loading(false);
done_callback(res)
})
.fail(function(res) {
ajax_loading(false);
if (res.status == 403) {
alert('Bạn không có quyền truy cập chức năng này');
} else if (res.status == 419) {
location.reload();
} else {
if (done_callback) {
return done_callback(res.responseJSON);
}
}
});
return false;
}

function show_pnotify(_message, _title, _type) {


_title = _title || 'Thông báo';
_message = _message || 'success';

new PNotify({
title: _title,
text: _message,
addclass: 'alert-danger',
type: _type
});
}

// Check if the logout message exists in the session flash data


var logoutMessage = null;

if (logoutMessage) {
// Display the logout message using show_pnotify
show_pnotify(logoutMessage.msg, 'Thông báo', 'error');
}
</script>
</body>

</html>

You might also like