目錄表
使用者註冊及登入
DokuWiki 預設
Google
整合型
實做
討論區
使用者註冊及登入
DokuWiki 預設
Google
plugin:authgoogle [DokuWiki]
(原文連結)
整合型
這好像更方便:
plugin:oauth [DokuWiki]
(原文連結)
實做
20170921
今天來試試主站的 oauth Google 登入(希望方便家人登入 ciangbrides.ml)
建立 Google APIs 的新專案
參考
Creating a Google API Console project and client ID | Google Sign-In for Websites | Google Developers
取得 client ID、secret 等 → 回 DokuWiki 系統設定中填入
參考網頁裡有說可以設定多個網址的樣子,這樣或許
MBA
本機上的主站也可以用 Google 登入囉?
→ 登出,但登入或註冊頁面都並沒有出現 Google 相關按鈕啊
→ 哈!原來我上一步填入 client ID、secret 後,沒有儲存設定
存了以後再登出,這樣登入頁面上就可以選 Google 登入了耶!!!
測試用自己的律師帳戶(GHSRobertLawyer)登入 ✔
測試用 Robertus0617@gmail.com 登入 → 顯示錯誤訊息說這個使用者的 profile 未允許用 Google 登入,表示系統有認這個郵件 = 既有的ghsrobert 使用者
用內建認證機制+ghsrobert 登入後,至帳號管理器,可看到律師帳戶的帳號及名稱都是「江瑋平」,也就是 Google 帶過來的名稱;另外這個帳戶被預設加入「user」及「google」兩個群組
再來需要幫既有(爸、媽、毓的)帳號設定可以使用 Google 登入,但我怎麼找不到說明文件擷圖的那個「User Profile」畫面?
哦?是在網址後面加
?do=profile
就行嗎?那這樣看來只有每個使用者自己才能設定允許自己使用 Google 登入了 → 設定 ghsrobert 自己可以用 Google 登入 → 登出 → 用 Google 登入成功!
再來弄主站的 oauth Facebook 登入
建立 FB 應用程式,然後選「Facebook 登入」,平台選「網站」→ 再來看不懂了……
還是商品應選「Account Kit」才對?→ 跳過伺服器驗證 → 複製「應用程式編號」及「應用程式密鑰」回來 DokuWiki 系統設定填入後儲存
其他 FB 端的設定好多哦
登出主站後,登入選項出現 Facebook → 用個人 FB 帳戶登入,有導到 FB 取得授權,但回來 DokuWiki 後:
Facebook did not provide the needed user info. Can't log you in
FB Account Kit 那邊剛才還沒儲存設定 → 儲存 → 還是不行
填入「網頁登入設定」裡的「伺服器網域」及「重新導向網址」→ 還是不行
回來重新設定「Facebook 登入」產品 → 還是不行
移除 Account Kit,並另外取得 Ciang Brides 黃金城應用程式的密鑰來填寫設定 → 還是不行
原來是一個還沒修掉的 bug
Facebook did not provide the needed user info. Can't log you in · Issue #17 · cosmocode/dokuwiki-plugin-oauth