Skip to content
Peter Boling edited this page Mar 28, 2022 · 6 revisions

Examples

Google 2-legged JWT

See: spec/examples/google_spec.rb

omniauth-facebook

Use with omniauth-facebook gem: https://github.com/simi/omniauth-facebook

Use with v2+ of this gem.

OAuth2::Response.register_parser(:facebook, []) do |body, response|
  if response.headers["content-type"].to_s.include?("application/json")
    OAuth2::Response::PARSERS[:json].call(body)
  else
    OAuth2::Response::PARSERS[:query].call(body)
  end
end

OmniAuth::Strategies::Facebook.configure do |config|
  config.token_params.merge!({ parse: :facebook })
end
Clone this wiki locally