aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2014-06-08 01:24:30 -0400
committerTeddy Wing2014-06-08 01:24:30 -0400
commit1256e1b0aa66be0104bf746092de801f5b74df90 (patch)
tree95ca46bae5626646b2a30e86ef33793f11bf7912
parentf1b7b5fea1dd1534013a63d9538bec4cacdb4b77 (diff)
downloadsellevate-1256e1b0aa66be0104bf746092de801f5b74df90.tar.bz2
context.io auth: get initial version working
API call to Context.IO that starts the OAuth pipeline flow that allows us to get access to a user's mailbox in our Context.IO system.
-rw-r--r--sellevate/contextio/auth.rb17
-rw-r--r--sellevate/sellevate.rb3
2 files changed, 18 insertions, 2 deletions
diff --git a/sellevate/contextio/auth.rb b/sellevate/contextio/auth.rb
index 3b1c7e7..c4a7297 100644
--- a/sellevate/contextio/auth.rb
+++ b/sellevate/contextio/auth.rb
@@ -1,3 +1,18 @@
require 'contextio'
-
+module Sellevate
+ module ContextIO
+
+ class Auth
+ def initialize
+ @contextio = ::ContextIO.new(API_KEY, API_SECRET)
+ end
+
+ def authenticate(email)
+ connection_token = @contextio.connect_tokens.create('http://google.com')
+ connect_tokens.browser_redirect_url
+ end
+ end
+
+ end
+end
diff --git a/sellevate/sellevate.rb b/sellevate/sellevate.rb
index 75ab9a6..c7c050f 100644
--- a/sellevate/sellevate.rb
+++ b/sellevate/sellevate.rb
@@ -3,4 +3,5 @@ require './contextio'
module Sellevate
end
-puts Sellevate::ContextIO::API_KEY
+contextio = Sellevate::ContextIO::Auth.new
+puts contextio.authenticate('sellevate.hack@gmail.com')