簡體   English   中英

hybridauth 2.13.0 + Google身份驗證

[英]hybridauth 2.13.0 + Google authentication

我在網站(PHP 7.0)上一直使用hybridauth進行社交登錄。

我現在將其更新到版本2.13.0(目前最新穩定)

我確實設法配置並正常工作了Facebook,Twitter,Linkedin。

我堅持使用Google。 這里的配置:

"Google" => array(
                "enabled" => true,
                "keys" => array("id" => "$social_google_id", "secret" => "$social_google_secret"),   
                "scope" => "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"  
            ),

一切都很好,但是當我收到消息時,看起來Google寄回的重定向URL在服務器級別的路徑中產生了誤解:

Forbidden

You don't have permission to access /hybridauth/ on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

網址字串為: https : //example.com/hybridauth/?hauth.done=Google&code=4/5QDkTNFvdiPkmQCct6m0bJ5Y_j0VjRSITw6EMn3NjyT6HPlrThx0iK5NrXkdxWnYoE0V_Y0ALV6iayH& Api+email/email/email/ email= email/email/email/email/email/email/email/email/email/email/email/email/email/email/email/ email.com? www.googleapis.com/auth/userinfo.email

如果我將最后一部分剪切為: https : //example.com/hybridauth/?hauth.done=Google&code=4/5QDkTNFvdiPkmQCct6m0bJ5Y_j0VjRSITw6EMn3NjyT6HPlrThx0iK5NrXkdxWnYoE0V_Y0ALV6a

然后工作,我從用戶那里獲取數據

我傾向於認為這與Google范圍內的斜線有關。

關於如何排序的任何想法? 可能是.htaccess中的重寫規則?

編輯

我再次檢查了,有問題的部分是“ .profile”

實際上,如果我僅指定電子郵件的作用范圍,那么問題是我還需要用戶名...有任何想法嗎?

這里是來自Apache的error_log

[2019年2月2日星期六08:26:31.790178] [:錯誤] [pid 4117:tid 47611986818816] [客戶端94.39.134.131:52882] [客戶端94.39.134.131] ModSecurity:使用代碼403(階段2)拒絕訪問。 在ARGS:scope匹配詞組“ .profile”。 [文件“ /etc/apache2/conf.d/modsec_vendor_configs/comodo_apache/08_Global_Other.conf”] [行“ 57”] [id“ 210580”] [版本“ 2”] [msg“ COMODO WAF:操作系統文件訪問嘗試| | example.com | F | 2“] [數據“在ARGS:scope中找到的匹配數據:.profile:電子郵件配置文件https:/www.googleapis.com/auth/userinfo.email https:/www.googleapis.com/auth /userinfo.profile“] [嚴重性” CRITICAL“] [標簽” CWAF“] [標簽” Other“] [主機名” example.com“] [uri” / hybridauth /“] [unique_id” BFVTJ0Unmh26fJ3XSeVQFeABAAE“],引薦來源網址: https ://accounts.google.it/accounts/SetSID

好的,對於引起此問題的任何人,都可以確認這是服務器端設置。

我聯系了我的托管服務提供商,他們確認該問題是誤報:

他們說:

“該塊與WAF mod_security服務器端有關,可能會產生誤報。我們排除了導致該行為的規則”

完成后,一切正常

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM