我正在使用omniauth-pinterest gem来验证Pinterest用户。除了默认" write_public"我需要通过" write_public"范围。什么是传递" read_public,write_public"的最佳方式。范围与身份验证请求?
答案 0 :(得分:2)
您好我没有尝试omniauth-pinterest
,但在omniauth-google-oauth2
我们可以在初始化文件中传递范围。正如我所期望的那样,你也可以像omniauth-google-oauth2
一样传递范围,如:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :pinterest, ENV['PINTEREST_APP_ID'], ENV['PINTEREST_APP_SECRET'], scope: ["read_public", "write_public"]
end