【rails】串接Google第三方登入失败,Authentication failure! authenticity_error

此时此刻看着这篇文章的你,是否也遇到下图的错误讯息,反覆检查程序码,也确实参照官方文件1官方文件2,但就是验证失败/images/emoticon/emoticon02.gif/images/emoticon/emoticon02.gif/images/emoticon/emoticon02.gif
https://ithelp.ithome.com.tw/upload/images/20220330/20147393tZZfwPwVOr.jpg

简要来说就是验证出了一些问题

解决方案是到 Gemfile 加入这个套件

gem "omniauth-rails_csrf_protection"

加入後,记得执行

bundle install

希望有帮助到一些同样遇到问题的人
那麽我们下次再见罗~~~

参考文件:

  1. https://stackoverflow.com/questions/66086606/could-not-authenticate-you-from-googleoauth2-because-authenticity-error
  2. https://github.com/cookpad/omniauth-rails_csrf_protection

<<:  曝露系数(Exposure factor)

>>:  探讨 C++ and C# 的差异

Day8 主动情蒐-情蒐流程、工具与漏洞简介

针对主动情蒐 主动情蒐指主动跟目标进行互动,会透过工具枚举所需的资讯,本系列文会介绍以下几种工具。 ...

Day 29 JavaScript : promise

昨天我们了解到 JavaScript 的非同步执行方法,但有时我们想要等到 A 事件结束後,再来进行...

Day[-2] 今天我想来点Kibana的Data Table

这个Data Table有点像是excel枢纽表的概念 做成一个表格形式来呈现你的资料 选Data ...

24 - 建立结构化的 Log (2/4) - Elasticsearch Ingest Pipeline 资料 Index 前的转换好帮手 - 基本介绍

建立结构化的 Log 系列文章 (1/4) - Elastic Common Schema 结构化 ...

Day 22:开心SQL,SQLDelight

Keyword: SQLDelight,SQL语法 到23日,引入SQLDelight,到在Andr...