Module: SalesforceChatter::Authentication
- Included in:
- API
- Defined in:
- lib/salesforce-chatter/authentication.rb
Instance Method Summary collapse
Instance Method Details
#authenticate(options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/salesforce-chatter/authentication.rb', line 5 def authenticate(={}) [:client_id] = SalesforceChatter.consumer_key [:client_secret] = SalesforceChatter.consumer_secret [:username] = SalesforceChatter.username [:password] = SalesforceChatter.password + SalesforceChatter.security_token [:grant_type] = 'password' response = post('services/oauth2/token', ) SalesforceChatter.oauth_token = response.access_token response end |
#authenticated? ⇒ Boolean
27 28 29 |
# File 'lib/salesforce-chatter/authentication.rb', line 27 def authenticated? !SalesforceChatter.oauth_token.nil? end |
#authentication ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/salesforce-chatter/authentication.rb', line 18 def authentication { :consumer_key => consumer_key, :consumer_secret => consumer_secret, :token => oauth_token, :token_secret => oauth_token_secret } end |