Forked from auth0/auth0.js
To log in to a specific organization, pass the ID or name as the organization parameter when creating the WebAuth client:
const webAuth = new WebAuth({
domain: '{YOUR_UPBOND_DOMAIN}',
clientID: '{YOUR_UPBOND_CLIENT_ID}'
});To run this sample locally, you can use the serve package:
npm install -g serve
serve -s .Then, open your browser and go to:
http://localhost:3000
You can use this sample to check whether you have an active session using UPBOND's SSO capabilities:
- Run the sample with
serve -s . - Open
http://localhost:3000in your browser. - At the bottom of the page, you'll see a Session Config section.
- Fill in only the
domainandclientIDfields, then click Update. - In a new browser tab, go to GSID mypage and log in.
auth0/auth0.js からフォーク
特定の組織にログインするには、WebAuth クライアントを作成する際に organization パラメータとしてIDまたは名前を指定します:
const webAuth = new WebAuth({
domain: '{YOUR_UPBOND_DOMAIN}',
clientID: '{YOUR_UPBOND_CLIENT_ID}'
});このサンプルをローカルで実行するには、serve パッケージを使用します:
npm install -g serve
serve -s .その後、ブラウザで以下のURLを開いてください:
http://localhost:3000
このサンプルを使って、UPBONDのSSO機能を利用したアクティブなセッションがあるかどうかを確認できます:
serve -s .を使ってサンプルを起動します。- ブラウザで
http://localhost:3000を開きます。 - ページの一番下に「Session Config」セクションがあります。
domainとclientIDフィールドのみ入力し、Update をクリックします。- 新しいブラウザタブでGSIDのマイページにアクセスしてログインします。
- サンプルページに戻り、「Check if you have an active session」セクションまでスクロールします。
- Check Session をクリックします。
セッションが有効であれば、結果としてユーザー情報が表示されます。
⚠️ 重要: このサンプルは、ブラウザでサードパーティCookieが有効になっていないと動作しません。セッション検出を正しく行うために、必ず有効になっていることをご確認ください。
- Return to the sample page and scroll to the "Check if you have an active session" section.
- Click Check Session.
If the session is active, you should see your user information appear in the result.
⚠️ Important: This sample will not work unless third-party cookies are enabled in your browser. Please make sure they're allowed for proper session detection.