
內容簡介
介紹
Subscriber Login for YouTube 是一款 WordPress 外掛,可用於使用 Google OAuth 2.0 認證與 YouTube Google 帳戶進行驗證。
特點
驗證 — 取得從 Google 驗證傳來的使用者;
取得使用者資訊 — 從使用者的 Google 帳戶取得使用者資料;
刷新令牌 — 刷新使用者的存取令牌;
撤銷令牌 — 撤銷使用者的存取令牌;
檢查使用者是否已訂閱指定的 YouTube 頻道;
欲了解更多關於 Google OAuth 2.0 的資訊,請參閱使用 OAuth 2.0 進行網路伺服器應用程式授權
需求
PHP 7.0 或更新版本;
WordPress 4.4 或更新版本;
設定
在使用 Subscriber Login for YouTube 之前,您需要在Google 控制台中設置一個網路應用程式的 Google 專案。這是 Google 要求使用者登錄的必備條件!該網路應用程式專案將提供:GOOGLE_CLIENT_ID、GOOGLE_CLIENT_SECRET和GOOGLE_REDIRECT_URI。
在您的專案中啟用「YouTube 資料 API v3」,並為其同意畫面添加範圍openid、email 和 https://www.googleapis.com/auth/youtube.readonly。詳細說明請參閱設置 OAuth 2.0。
存取範圍
這些範圍由 Google 用於限制您的應用程式存取使用者帳戶資料認證。有關YouTube 資料 API範圍的詳細資訊,請閱讀更多。
使用
啟用外掛後,外掛將自動:
在 WordPress 登入頁面添加「使用 YouTube 登入」按鈕。參見截圖 #1。
在 WordPress 個人簡介頁面添加「撤銷存取權限」的鏈接。參見截圖 #2。
許可證
Subscriber Login for YouTube 是根據GPL v2.0 或更高版本的開源軟體。
外掛標籤
開發者團隊
② 後台搜尋「Subscriber Login for YouTube」→ 直接安裝(推薦)
📦 歷史版本下載
原文外掛簡介
Introduction
Subscriber Login for YouTube is a WordPress plugin for Google OAuth 2.0 authentication with YouTube Google account.
Features
Authentication — get the user coming from Google authentication;
Get user information — get the user data from their Google account;
Refresh token — refresh the user’s access token;
Revoke token — revoke the user’s access token;
Check if an user is subscribed on a given YouTube channel;
For more information about Google OAuth 2.0, please see Using OAuth 2.0 for Web Server Applications
Requirements
PHP 7.0 or later;
WordPress 4.4 or later;
Setting
Before using Subscriber Login for YouTube, you need to set up an Google project for web application in Google Console. It’s a Google requirement for users to login! The web application project will provide: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, and GOOGLE_REDIRECT_URI.
Activate the “YouTube Data API v3” in your project and add the scopes openid, email, and https://www.googleapis.com/auth/youtube.readonly for its consent screen. See more details in Setting up OAuth 2.0.
Access Scopes
The scopes are used by Google to limit your application access to the user account data. Read more about YouTube Data API scopes.
Usage
After you activated the plugin, then the plugin will automatically:
add the “Sign in with YouTube” button to the WordPress login page. See screenshot #1.
add the “Revoke access” link to the WordPress profile page. See screenshot #2.
License
Subscriber Login for YouTube is open-sourced software licensed under the GPL v2.0 or later.
