Module: FellowshipOneAPI::OAuth
- Included in:
- CredentialsAuthentication, OAuthAuthentication
- Defined in:
- lib/f1api/oauth.rb,
lib/f1api/oauth/oauth_authentication.rb,
lib/f1api/oauth/credentials_authentication.rb
Overview
Wrapper around the OAuth v1.0 specification using the oauth
gem.
The Fellowship One API has two methods of authentication:
- OAuthAuthentication
-
This is the default method if no method is declared. This method allows Fellowship Tech to handle the authentication and we redirect back to your app.
- CredentialsAuthentication
-
The methods lets the consumer submit credentials and verify authentication.
Defined Under Namespace
Modules: CredentialsAuthentication, OAuthAuthentication
Instance Attribute Summary collapse
-
#authenticated_user_uri ⇒ Object
readonly
The URI for the resource of the authenticated user.
-
#oauth_access_token ⇒ Object
(also: #access_token)
The OAuth access token object where all requests are made off of.
-
#oauth_consumer ⇒ Object
(also: #consumer)
readonly
The OAuth consumer object.
-
#oauth_consumer_key ⇒ Object
(also: #consumer_key)
The OAuth consumer key.
-
#oauth_consumer_secret ⇒ Object
(also: #consumer_secret)
The OAuth consumer secret.
Instance Method Summary collapse
-
#load_consumer_config(type = :portal, site_url = nil) ⇒ Object
Creates the OAuth consumer object.
Instance Attribute Details
#authenticated_user_uri ⇒ Object (readonly)
The URI for the resource of the authenticated user
30 31 32 |
# File 'lib/f1api/oauth.rb', line 30 def authenticated_user_uri @authenticated_user_uri end |
#oauth_access_token ⇒ Object Also known as: access_token
The OAuth access token object where all requests are made off of
22 23 24 |
# File 'lib/f1api/oauth.rb', line 22 def oauth_access_token @oauth_access_token end |
#oauth_consumer ⇒ Object (readonly) Also known as: consumer
The OAuth consumer object
26 27 28 |
# File 'lib/f1api/oauth.rb', line 26 def oauth_consumer @oauth_consumer end |
#oauth_consumer_key ⇒ Object Also known as: consumer_key
The OAuth consumer key. This will get set automatically from the YAML config file if not set explictly
11 12 13 |
# File 'lib/f1api/oauth.rb', line 11 def oauth_consumer_key @oauth_consumer_key end |
#oauth_consumer_secret ⇒ Object Also known as: consumer_secret
The OAuth consumer secret. This will get set automatically from the YAML config file if not set explictly
17 18 19 |
# File 'lib/f1api/oauth.rb', line 17 def oauth_consumer_secret @oauth_consumer_secret end |
Instance Method Details
#load_consumer_config(type = :portal, site_url = nil) ⇒ Object
Creates the OAuth consumer object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/f1api/oauth.rb', line 33 def load_consumer_config(type = :portal, site_url = nil) case type when :portal = FellowshipOneAPI::Configuration. when :weblink = FellowshipOneAPI::Configuration. end @oauth_consumer_key ||= FellowshipOneAPI::Configuration.consumer_key @oauth_consumer_secret ||= FellowshipOneAPI::Configuration.consumer_secret url = site_url.nil? ? FellowshipOneAPI::Configuration.site_url : site_url @oauth_consumer = ::OAuth::Consumer.new(@oauth_consumer_key, @oauth_consumer_secret, {:site => url, :request_token_path => FellowshipOneAPI::Configuration.request_token_path, :access_token_path => FellowshipOneAPI::Configuration.access_token_path, :authorize_path => }) end |