Class: Fb::Auth
- Inherits:
-
Object
- Object
- Fb::Auth
- Defined in:
- lib/fb/auth.rb,
lib/fb/auth/version.rb
Overview
Provides methods to authenticate a user with the Facebook OAuth flow.
Constant Summary collapse
- VERSION =
Returns the SemVer-compatible gem version.
"0.1.3"
Instance Method Summary collapse
-
#access_token ⇒ String
The non-expiring access token of an authenticated Facebook account.
-
#initialize(options = {}) ⇒ Auth
constructor
A new instance of Auth.
-
#url ⇒ String
A url to Facebook’s account authentication.
Constructor Details
#initialize(options = {}) ⇒ Auth
Returns a new instance of Auth.
17 18 19 20 |
# File 'lib/fb/auth.rb', line 17 def initialize( = {}) @redirect_uri = [:redirect_uri] @code = [:code] end |
Instance Method Details
#access_token ⇒ String
Returns the non-expiring access token of an authenticated Facebook account.
28 29 30 31 32 |
# File 'lib/fb/auth.rb', line 28 def access_token response_body = Fb::Request.new(path: '/oauth/access_token', params: long_term_token_params).run response_body["access_token"] end |
#url ⇒ String
Returns a url to Facebook’s account authentication.
23 24 25 |
# File 'lib/fb/auth.rb', line 23 def url Fb::Request.new().url end |