TUNGKAO API 문서
API · yahoo_login

Yahoo로 로그인

Yahoo에 직접 등록하지 않고 사이트에 'Yahoo로 로그인' 버튼을 추가하세요. 제공 정보: name, email, photo

🕒 최근 업데이트: 태국 시간 (UTC+07:00) · ✅ 기존 코드 그대로 작동

🤖 AI에게 연동 코드 맡기기

이 링크를 AI에게 주거나(전체 API Markdown) 버튼을 누르세요. 프롬프트가 복사되고 AI가 열립니다

https://app.tungkao.com/docs/api/yahoo_login.md?lang=ko
https://api.tungkao.com/changelog/yahoo_login.json

이 링크는 이 API의 업데이트를 JSON으로 돌려줍니다 (key 불필요, 모든 출처 허용). 관리자 페이지에 “업데이트 공지” 상자로 보여 주고 last_updated가 바뀌면 “새 글”로 표시하세요

ChatGPT ↗Claude ↗Gemini ↗Grok ↗

복사 후 열기: AI 버튼을 누르면 프롬프트가 자동 복사됩니다. 입력창이 비어 있으면 붙여넣기 하세요

🔑 사용할 키

판매자 포털(API key)에서 yahoo_login 키를 만들고 모든 요청에 이 header를 보내세요 — 다른 서비스의 키는 여기서 작동하지 않습니다

Authorization: Bearer $TUNGKAO_KEY

🔗 로그인 버튼 링크

https://api.tungkao.com/oauth/authorize?client_id=<CLIENT_ID>&redirect_uri=https%3A%2F%2Fyourshop.com%2Fauth%2Fcallback&state=<RANDOM>

🛡️ 모든 과정은 tungkao에서 끝납니다: 사용자는 Yahoo로 로그인한 뒤 항상 tungkao로 먼저 돌아오고, 실제 로그인 성공(또는 로그인 중 취소) 시에만 당신의 링크로 보냅니다 — 링크를 직접 연 사람은 tungkao 페이지만 봅니다. '회원'에서 🌐 도메인(인증)과 ↩️ 돌아갈 링크를 설정하세요.

제공 정보: name, email, photo

📋 진행 방법

  1. 제공자 키를 만든 뒤 '로그인 회원'에서 사이트 이름과 돌아갈 주소(https, 정확히 일치)를 설정하세요.
  2. 로그인 버튼은 사용자를 client_id(키 ID), redirect_uri, state(매번 새 무작위 값, 세션에 저장)와 함께 /oauth/authorize로 보냅니다.
  3. 사용자가 redirect_uri?code=…&state=…로 돌아오면 state 확인 → 서버가 2분 안에 POST /v1/login/token 호출.
  4. data.user(예: 7F3K9QX2-yourshopcom)를 회원 ID로 쓰세요 — 같은 사람은 항상 같은 ID.

📡 API 호출 + 코드 예제

POST/v1/login/token
curl -X POST https://api.tungkao.com/v1/login/token \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"from the redirect","redirect_uri":"https://yourshop.com/auth/callback"}'
GET/v1/login/users?limit=50
curl -X GET https://api.tungkao.com/v1/login/users?limit=50 \
  -H "Authorization: Bearer $TUNGKAO_KEY"

📖 Summary: using sign-in keys on several sites

경우key 설정 (API Keys 페이지)결과
One site, 2 keys of the same provider (e.g. website + app, both Google)Both keys: Combined (default)The same person gets the same user ID in both ✅
One site, 2 keys of the same provider, counted as separate accountsBoth keys: SeparateThe same person gets a different user ID on each key
2 sister sites sharing membersBoth keys: Group AA member has the same user ID on both sites ✅
2 unrelated sites that must not link membersBoth keys: SeparateDifferent user IDs, so the sites can't link their members ✅
A Google key and a LINE key (different providers)Any settingAlways different user IDs — they are different provider accounts
A key that already has sign-ins needs a different groupNot allowed (locked 🔒)Create a new key in the wanted group, so member IDs on your site never change

Set it on the “Sign-in user IDs between keys” card on the API Keys page before go-live (new keys default: Combined). Several keys may use the same domain.

전체 예제 (버튼 + 콜백 + code 교환)

// npm i express express-session
import express from "express";
import session from "express-session";
import crypto from "node:crypto";

const KEY = process.env.TUNGKAO_KEY;            // API key (tk_live_…) server-side only
const CLIENT_ID = process.env.TUNGKAO_CLIENT_ID; // the key id (shown in the portal), not a secret
const REDIRECT = "https://yourshop.com/auth/callback"; // must match the registered URL exactly

const app = express();
app.use(session({ secret: process.env.SESSION_SECRET, resave: false, saveUninitialized: false, cookie: { secure: true, sameSite: "lax" } }));

// 1) your "Sign in" button links here
app.get("/auth/login", (req, res) => {
  req.session.state = crypto.randomBytes(24).toString("base64url");
  const u = new URL("https://api.tungkao.com/oauth/authorize");
  u.search = new URLSearchParams({ client_id: CLIENT_ID, redirect_uri: REDIRECT, state: req.session.state });
  res.redirect(u);
});

// 2) the user comes back with a code
app.get("/auth/callback", async (req, res) => {
  if (!req.query.state || req.query.state !== req.session.state) return res.status(400).send("state mismatch");
  delete req.session.state;
  if (req.query.error) return res.redirect("/login?cancelled=1");
  // 3) exchange the code for the user (within 2 minutes)
  const r = await fetch("https://api.tungkao.com/v1/login/token", {
    method: "POST",
    headers: { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json" },
    body: JSON.stringify({ code: req.query.code, redirect_uri: REDIRECT }),
  });
  const j = await r.json();
  if (!j.success) return res.status(400).send(j.error.message);
  req.session.user = j.data; // j.data.user = permanent member id, e.g. 7F3K9QX2-yourshopcom
  res.redirect("/");
});
app.listen(3000);
제공자서비스제공 정보
Googlegoogle_login이름, 인증된 이메일, 사진
LINEline_login이름, 사진, 이메일(동의 시)
Facebookfacebook_login이름, 사진, 이메일
TikToktiktok_login닉네임, 아바타 (이메일 없음)
Discorddiscord_login이름, 아바타, 이메일
Telegramtelegram_loginname, username, photo
X (Twitter)x_loginname, username, photo
Microsoftmicrosoft_loginname, email (Hotmail/Outlook)
GitHubgithub_loginname, email, avatar
Appleapple_loginpermanent member ID (no name or email in this mode)
Steamsteam_loginname, avatar and SteamID (no email)
Twitchtwitch_loginname, email, avatar
LinkedInlinkedin_loginname, email, photo
Kakaokakao_loginname, photo (email once Kakao approves it)
NAVERnaver_loginname, email, photo
Zalozalo_loginname, photo (no email)
Spotifyspotify_loginname, email, photo
Redditreddit_loginusername, avatar (no email)
GitLabgitlab_loginname, email, avatar
Robloxroblox_loginname, avatar (no email)
Epic Gamesepicgames_logindisplay name (no email)
Yahooyahoo_loginname, email, photo
Slackslack_loginname, email, photo
Amazonamazon_loginname, email

📚 사용 예시

예시 1

A “Sign in with Yahoo” button on your site

상황: A visitor taps Sign in with Yahoo on your site

요청
GET /oauth/authorize?client_id=<CLIENT_ID>&redirect_uri=https://yourshop.com/auth/callback&state=xyz

➡️ The user signs in with Yahoo and returns to redirect_uri with a code and the same state

예시 2

Exchange the code for the user (server side)

상황: Your server receives the code on the callback page (exchange within 2 minutes)

요청
POST /v1/login/token
{
  "code": "<code from the callback>",
  "redirect_uri": "https://yourshop.com/auth/callback"
}
응답 예시
{
  "success": true,
  "data": {
    "user": "7F3K9QX2-yourshopcom",
    "provider": "yahoo",
    "name": "Somchai",
    "is_new_user": true
  }
}

➡️ Use user as the member id in your database (stable per person)

예시 3

A returning user signs in

상황: The same person signs in with Yahoo again

응답 예시
{
  "success": true,
  "data": {
    "user": "7F3K9QX2-yourshopcom",
    "is_new_user": false,
    "login_count": 5
  }
}

➡️ Same user every time → look up the member and sign them in

예시 4

One site, two Yahoo keys (website + app)

상황: Separate keys for website and app, same members

➡️ Keep both keys “Combined” (default) before go-live → same user for the same person. Choose “Separate” to keep them apart

예시 5

List members who signed in

상황: You want to browse or search members of this key

요청
GET /v1/login/users?q=somchai&limit=50

➡️ Returns members with last sign-in time and count

예시 6

The user cancels during sign-in

상황: The user cancels on the Yahoo screen

➡️ Returns to redirect_uri with error instead of code; show a retry button

💡 더 보기

📜 이 API의 업데이트 기록

  1. 추가 태국 시간 (UTC+07:00)
    Sign-in: choose whether user IDs are combined or separate between keys (whole account / group A–E / separate). New keys default to combined; keys that already have sign-ins stay in their group
  2. 추가 태국 시간 (UTC+07:00)
    15 new sign-in providers: Apple, Steam, Twitch, LinkedIn, Kakao, NAVER, Zalo, Spotify, Reddit, GitLab, Roblox, Epic Games, Yahoo, Slack, Amazon. Same /oauth/authorize link and POST /v1/login/token as every existing provider (each one goes on sale when ready; see the services page)
  3. 추가 태국 시간 (UTC+07:00)
    API update announcements by webhook: new api.update event (opt in per key on the key card; off by default)
  4. 추가 태국 시간 (UTC+07:00)
    error.user_message: ready-to-show text for end users on outages, no credits or key problems (white-label keys omit tungkao.com)
  5. 추가 태국 시간 (UTC+07:00)
    GET /status: 서비스별 API 상태 (키 불필요)
  6. 추가 태국 시간 (UTC+07:00)
    키 켜기/끄기 스위치와 상태 변경 시각 + 웹사이트당 서비스별 키 1개
  7. 개선 태국 시간 (UTC+07:00)
    API v1 영구 고정(추가만 가능) + X-Tungkao-Api-Version header + 12개월 사전 지원 종료 알림
  8. 문서 태국 시간 (UTC+07:00)
    API별 문서 페이지와 AI 링크 (10개 언어)
  9. 보안 태국 시간 (UTC+07:00)
    API 키별 도메인 인증 (키 1개 = 사이트 1개) — 기존 키는 그대로 작동
  10. 추가 태국 시간 (UTC+07:00)
    선택형 HMAC 요청 서명 — 켜지 않으면 변화 없음
  11. 추가 태국 시간 (UTC+07:00)
    API 키 기간·만료 알림·갱신 — 키 문자열은 그대로
  12. 추가 태국 시간 (UTC+07:00)
    모든 서비스에 test 모드 키 (모의, 무료)

✅ 기존 코드 그대로 작동

🛡️ 안정성 약속: 한 번 연동하면 계속 작동

🚦 시스템 상태 (GET /status)

API 정상 여부를 언제든 확인 — 키 불필요

GET https://api.tungkao.com/status

curl https://api.tungkao.com/status
{
  "success": true,
  "data": {
    "status": "ok",
    "services": [
      { "id": "slip_verify", "status": "ok", "routes": ["ok", "ok", "busy"] },
      { "id": "slip_deposit", "status": "ok", "routes": ["ok", "ok", "busy"] },
      { "id": "login", "status": "ok" },
      { "id": "telegram", "status": "ok" },
      { "id": "discord", "status": "ok" },
      { "id": "email", "status": "busy" },
      { "id": "crypto", "status": "ok" },
      { "id": "core", "status": "ok" }
    ],
    "paused": [],
    "updated_at": "2026-11-14T12:00:00.000Z"
  }
}

🏷️ TUNGKAO 표기 요구 사항

Powered by TUNGKAO