sso 인증 기능 구현
This commit is contained in:
@@ -4,7 +4,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
if (ssoLoginButton) {
|
||||
ssoLoginButton.addEventListener('click', () => {
|
||||
// Open the SSO provider's login page in a popup
|
||||
const ssoUrl = '/sso_popup.html'; // This is our simulated SSO provider
|
||||
const ssoUrl = 'https://sso.hmac.kr/'; // Real SSO provider URL
|
||||
const popupWidth = 500;
|
||||
const popupHeight = 600;
|
||||
const left = (screen.width / 2) - (popupWidth / 2);
|
||||
@@ -18,10 +18,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
// Listen for a message from the popup
|
||||
window.addEventListener('message', (event) => {
|
||||
// IMPORTANT: In a real app, verify the origin of the message for security
|
||||
// if (event.origin !== 'https://your-sso-provider.com') {
|
||||
// return;
|
||||
// }
|
||||
// IMPORTANT: Verify the origin of the message for security
|
||||
if (event.origin !== 'https://sso.hmac.kr') {
|
||||
console.warn('Received message from untrusted origin:', event.origin);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the message contains the expected data structure
|
||||
if (event.data && event.data.type === 'LOGIN_SUCCESS' && event.data.token) {
|
||||
|
||||
Reference in New Issue
Block a user