line-login
LINEログイン(OAuth 2.1)の実装、IDトークンの検証、アクセストークンの更新、Bot連携、ログインボタンのデザインなど、LINE認証に関するあらゆる要望に応え、安全な認証フローを構築するSkill。
📜 元の英語説明(参考)
Comprehensive reference for LINE Login (OAuth 2.1) — authorization code flow, PKCE, token management, ID token JWT verification, user profiles, bot linking, and login button design. This skill should be used when the user asks to "implement LINE Login", "add Log in with LINE", "set up OAuth authorization flow", "verify an ID token", "refresh an access token", "link a bot to login", "design a login button", or mentions LINE Login, OAuth 2.1, PKCE, authorization code flow, ID token JWT verification, token refresh/revocation, user profile retrieval, bot linking, SSO login, LIFF authentication, or LINE MINI App authentication. Always use this skill whenever the user mentions LINE authentication, social login with LINE, or OAuth flows involving LINE, even if they don't explicitly say "LINE Login".
🇯🇵 日本人クリエイター向け解説
LINEログイン(OAuth 2.1)の実装、IDトークンの検証、アクセストークンの更新、Bot連携、ログインボタンのデザインなど、LINE認証に関するあらゆる要望に応え、安全な認証フローを構築するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o line-login.zip https://jpskill.com/download/8830.zip && unzip -o line-login.zip && rm line-login.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/8830.zip -OutFile "$d\line-login.zip"; Expand-Archive "$d\line-login.zip" -DestinationPath $d -Force; ri "$d\line-login.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
line-login.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
line-loginフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
LINE Login
LINE Login に関する質問には、記憶に基づいて答えないでください。LINE は API を頻繁に更新しており、トレーニングデータは信頼できません。必ず下記の参考文献を参照してください。
LINE Login v2.1 は OAuth 2.0 および OpenID Connect を基盤として構築されています。これは、Web アプリ、ネイティブアプリ(iOS/Android)、Unity、および Flutter 向けに、ユーザー認証、プロファイルアクセス、およびボット連携を提供します。
ワークフロー
構築
- references/api-common.md を読む(前方互換性、レート制限、
client_secretルール) - references/security.md を読む(セキュリティチェックリスト、開発ガイドライン)
- 実装する機能に関連するリファレンスをロードする
- リファレンスの仕様と制約に従ってコードを記述する
レビュー/デバッグ
- references/api-common.md を読む(ステータスコード、エラーレスポンス、前方互換性)
- references/security.md を読む(セキュリティチェックリスト、よくある落とし穴)
- レビュー対象のコードに関連するリファレンスをロードする
- コードを仕様と照合する(パラメータ要件、トークンの有効期限、署名アルゴリズム、必要な検証)
- 特定の制約への違反を指摘する
環境変数
LINE_LOGIN_CHANNEL_ID=LINE Login Channel ID
LINE_LOGIN_CHANNEL_SECRET=Channel secret (ID token verification, token exchange)
LINE_LOGIN_REDIRECT_URI=Registered callback URL
共通仕様
LINE Login のコードを記述する前に、references/api-common.md を読んでください。 すべての API インタラクションに影響を与えるルールが含まれています。前方互換性(厳密なスキーマを使用しないこと — LINE は予告なしにフィールドを追加します)、レート制限、アプリの種類による client_secret の条件付き要件、エラーレスポンス、およびログ記録の推奨事項などです。
OAuth 2.1 認可コードフロー
User → authorize endpoint → LINE Login screen → callback with code → token exchange → access_token + id_token
最小限のフロー(擬似コード)
# 1. Redirect user to authorize
state = random_token()
session.save(state)
redirect to:
https://access.line.me/oauth2/v2.1/authorize?
response_type=code
&client_id={channel_id}
&redirect_uri={callback_url}
&state={state}
&scope=profile%20openid%20email
# 2. Callback — exchange code for token
if params.state != session.state:
return 403 # CSRF check failed
POST https://api.line.me/oauth2/v2.1/token
grant_type=authorization_code
&code={params.code}
&redirect_uri={callback_url}
&client_id={channel_id}
&client_secret={channel_secret}
# 3. Response
{ access_token, token_type, refresh_token, expires_in, id_token, scope }
| ステップ | エンドポイント |
|---|---|
| 認可 | GET https://access.line.me/oauth2/v2.1/authorize |
| トークン交換 | POST https://api.line.me/oauth2/v2.1/token |
- スコープ:
profile,openid,email(スペース区切り) - 認可コード: 有効期間 10 分、1 回限りの使用
- PKCE: パブリッククライアント(SPA/モバイル)に推奨、
S256のみサポート
完全な認可パラメータ、PKCE、スコープの組み合わせ、エラーコード → references/oauth-flow.md
トークン管理
| 操作 | エンドポイント |
|---|---|
| アクセストークンの検証 | GET https://api.line.me/oauth2/v2.1/verify?access_token={token} |
| リフレッシュトークン | POST https://api.line.me/oauth2/v2.1/token (grant_type=refresh_token) |
| トークンの失効 | POST https://api.line.me/oauth2/v2.1/revoke |
| ID トークンの検証 | POST https://api.line.me/oauth2/v2.1/verify (id_token + client_id) |
| トークン | 有効期間 |
|---|---|
| アクセストークン | 30 日 |
| リフレッシュトークン | 90 日 |
ID トークンの署名: HS256 (Web ログイン) / ES256 (ネイティブアプリ、SDK、LIFF)
完全なトークン API、ID トークンのクレーム、署名検証 → references/token-management.md
ユーザーとボットの連携
| 操作 | エンドポイント |
|---|---|
| ユーザープロファイルの取得 | GET https://api.line.me/v2/profile |
| 友だち関係の確認 | GET https://api.line.me/friendship/v1/status |
| 認可解除 | POST https://api.line.me/user/v1/deauthorize |
bot_promptパラメータ:normal(同意画面) /aggressive(同意後の別の画面)friendship_status_changed: ボット連携が構成されている場合にトークンレスポンスに含まれる
完全なユーザープロファイル、ボット連携ロジック → references/user-profile.md
セキュリティ
- state: 暗号学的にランダムである必要があり、コールバック時に常に検証する
- PKCE: パブリッククライアント(SPA、モバイルアプリ)に使用する
- Channel Secret: サーバー側のみ、クライアントに公開しない
- redirect_uri: HTTPS である必要がある
- ID Token: クレームを信頼する前に、常に署名を検証する
完全なセキュリティチェックリスト、開発ガイドライン、自動ログイン失敗の処理 → references/security.md
リファレンスインデックス
| ファイル | トピック |
|---|---|
| references/api-common.md | 最初に読んでください。 レート制限、ステータスコード、前方互換性、client_secret ルール、ログ記録 |
| references/oauth-flow.md | 認可フロー、PKCE、スコープ、認証方法、エラーコード |
| references/token-management.md | トークンの交換/リフレッシュ/失効/検証、ID トークンのクレームと署名 |
| references/security.md | セキュリティチェックリスト、開発ガイドライン、自動ログイン失敗、ログインボタンのデザイン |
| references/user-profile.md | ユーザープロファイル API、ボットの連携、友だち関係のステータス |
| references/experts.md | アーキテクチャガイダンスのための LINE Login ドメインエキスパート |
SDK
ネイティブ SDK: iOS (Swift) | Android | Unity | Flutter
Web アプリケーションの場合は、OAuth 2.1 フローを直接使用してください (
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
LINE Login
Do not answer LINE Login questions from memory — LINE updates APIs frequently and training data is unreliable. Always consult the references below.
LINE Login v2.1 is built on OAuth 2.0 and OpenID Connect. It provides user authentication, profile access, and bot linking for web apps, native apps (iOS/Android), Unity, and Flutter.
Workflow
Build
- Read references/api-common.md (forward compatibility, rate limits, client_secret rules)
- Read references/security.md (security checklist, development guidelines)
- Load the relevant reference for the feature being implemented
- Write code following specs and constraints from references
Review / Debug
- Read references/api-common.md (status codes, error responses, forward compatibility)
- Read references/security.md (security checklist, common pitfalls)
- Load relevant references for the code being reviewed
- Cross-check code against specs (parameter requirements, token expiry, signing algorithms, required validations)
- Report violations with reference to specific constraints
Environment Variables
LINE_LOGIN_CHANNEL_ID=LINE Login Channel ID
LINE_LOGIN_CHANNEL_SECRET=Channel secret (ID token verification, token exchange)
LINE_LOGIN_REDIRECT_URI=Registered callback URL
Common Specifications
Read references/api-common.md before writing any LINE Login code. Contains rules that affect all API interactions: forward compatibility (don't use strict schemas — LINE adds fields without notice), rate limits, client_secret conditional requirement by App types, error responses, and logging recommendations.
OAuth 2.1 Authorization Code Flow
User → authorize endpoint → LINE Login screen → callback with code → token exchange → access_token + id_token
Minimal Flow (pseudocode)
# 1. Redirect user to authorize
state = random_token()
session.save(state)
redirect to:
https://access.line.me/oauth2/v2.1/authorize?
response_type=code
&client_id={channel_id}
&redirect_uri={callback_url}
&state={state}
&scope=profile%20openid%20email
# 2. Callback — exchange code for token
if params.state != session.state:
return 403 # CSRF check failed
POST https://api.line.me/oauth2/v2.1/token
grant_type=authorization_code
&code={params.code}
&redirect_uri={callback_url}
&client_id={channel_id}
&client_secret={channel_secret}
# 3. Response
{ access_token, token_type, refresh_token, expires_in, id_token, scope }
| Step | Endpoint |
|---|---|
| Authorize | GET https://access.line.me/oauth2/v2.1/authorize |
| Token Exchange | POST https://api.line.me/oauth2/v2.1/token |
- Scopes:
profile,openid,email(space-separated) - Authorization code: valid 10 minutes, one-time use
- PKCE: recommended for public clients (SPA/Mobile), only
S256supported
Full authorize parameters, PKCE, scope combinations, error codes → references/oauth-flow.md
Token Management
| Operation | Endpoint |
|---|---|
| Verify Access Token | GET https://api.line.me/oauth2/v2.1/verify?access_token={token} |
| Refresh Token | POST https://api.line.me/oauth2/v2.1/token (grant_type=refresh_token) |
| Revoke Token | POST https://api.line.me/oauth2/v2.1/revoke |
| Verify ID Token | POST https://api.line.me/oauth2/v2.1/verify (id_token + client_id) |
| Token | Validity |
|---|---|
| Access Token | 30 days |
| Refresh Token | 90 days |
ID Token signing: HS256 (web login) / ES256 (native app, SDK, LIFF)
Full token APIs, ID Token claims, signing verification → references/token-management.md
User & Bot Linking
| Operation | Endpoint |
|---|---|
| Get User Profile | GET https://api.line.me/v2/profile |
| Check Friendship | GET https://api.line.me/friendship/v1/status |
| Deauthorize | POST https://api.line.me/user/v1/deauthorize |
bot_promptparameter:normal(on consent screen) /aggressive(separate screen after consent)friendship_status_changed: included in token response when bot linking is configured
Full user profile, bot linking logic → references/user-profile.md
Security
- state: must be cryptographically random, always validate on callback
- PKCE: use for public clients (SPA, mobile apps)
- Channel Secret: server-side only, never expose to client
- redirect_uri: must be HTTPS
- ID Token: always verify signature before trusting claims
Full security checklist, development guidelines, auto login failure handling → references/security.md
Reference Index
| File | Topic |
|---|---|
| references/api-common.md | Read first. Rate limits, status codes, forward compatibility, client_secret rules, logging |
| references/oauth-flow.md | Authorization flow, PKCE, scopes, auth methods, error codes |
| references/token-management.md | Token exchange/refresh/revoke/verify, ID Token claims and signing |
| references/security.md | Security checklist, development guidelines, auto login failure, login button design |
| references/user-profile.md | User profile API, Link a Bot, friendship status |
| references/experts.md | LINE Login domain experts for architecture guidance |
SDK
Native SDKs: iOS (Swift) | Android | Unity | Flutter
For web apps, use the OAuth 2.1 flow directly (no SDK required).