Class: OmniAuth::Strategies::Facebook
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Facebook
- Defined in:
- lib/omniauth/strategies/facebook.rb
Constant Summary
- DEFAULT_SCOPE =
'email,offline_access'
Instance Method Summary (collapse)
- - (Object) access_token_options
- - (Object) authorize_params
- - (Object) build_access_token
-
- (Object) callback_url
NOTE if we're using code from the signed request cookie then FB sets the redirect_uri to '' during the authorize phase + it must match during the access_token phase: github.com/facebook/php-sdk/blob/master/src/base_facebook.php#L348.
- - (Object) raw_info
- - (Object) signed_request
Instance Method Details
- (Object) access_token_options
84 85 86 |
# File 'lib/omniauth/strategies/facebook.rb', line 84 def ..inject({}) { |h,(k,v)| h[k.to_sym] = v; h } end |
- (Object) authorize_params
88 89 90 91 92 93 94 |
# File 'lib/omniauth/strategies/facebook.rb', line 88 def super.tap do |params| params.merge!(:display => request.params['display']) if request.params['display'] params.merge!(:state => request.params['state']) if request.params['state'] params[:scope] ||= DEFAULT_SCOPE end end |
- (Object) build_access_token
62 63 64 65 66 |
# File 'lib/omniauth/strategies/facebook.rb', line 62 def build_access_token { super }.tap do |token| token..merge!() end end |
- (Object) callback_url
NOTE if we're using code from the signed request cookie then FB sets the redirect_uri to '' during the authorize phase + it must match during the access_token phase: github.com/facebook/php-sdk/blob/master/src/base_facebook.php#L348
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/omniauth/strategies/facebook.rb', line 72 def callback_url if @authorization_code_from_cookie '' else if ..respond_to?(:callback_url) ..callback_url else super end end end |
- (Object) raw_info
58 59 60 |
# File 'lib/omniauth/strategies/facebook.rb', line 58 def raw_info @raw_info ||= access_token.get('/me').parsed end |
- (Object) signed_request
96 97 98 99 100 101 |
# File 'lib/omniauth/strategies/facebook.rb', line 96 def signed_request @signed_request ||= begin = request.["fbsr_#{client.id}"] and parse_signed_request() end end |