Skip to content
Ondra edited this page Aug 24, 2012 · 4 revisions

Automaticaly open autorization url a waiting for callback. Launchy gem is required

gem install launchy

Steps:

  1. create server
  2. launch browser and redirect to google api
  3. confirm and google api redirect to localhost
  4. server get code and start session
  5. close server - you are login

Configure

GoogleApi.config.client_id = "123456.apps.googleusercontent.com"
GoogleApi.config.client_secret = "123456123456123456"

Start

server: address for autorization callback, optional is localhost, must be full path!
port: server port

# default:
#   server = http://localhost/oauth2callback
#   port = 0 (get first free port)
GoogleApi::SERVICE::Session.login_by_line(server, port)

Other methods:

Clone this wiki locally