SSO 팝업 로그인 데모

Authorization Code + PKCE를 팝업으로 수행하고, 콜백 페이지가 postMessage로 부모 창에 코드를 전달합니다.

로그인하지 않았습니다.

사용법

const sso = new SsoPopup({
  authority:   'http://localhost:9100',
  clientId:    'popup-client',
  redirectUri: window.location.origin + '/callback.html',
  scope:       'openid profile email'
});

const tokens = await sso.signIn();   // 로그인
const tokens = await sso.signUp();   // 회원가입 (반환 형태 동일)

// 자체 가입 폼을 만들 때
const terms = await sso.getTerms();
const free  = await sso.isUsernameAvailable('hong');
await sso.register({ username, password, name, agreements });