-
Notifications
You must be signed in to change notification settings - Fork 1
Login by line
Ondra edited this page Aug 24, 2012
·
4 revisions
Automaticaly open autorization url a waiting for callback. Launchy gem is required
gem install launchy
- create server
- launch browser and redirect to google api
- confirm and google api redirect to localhost
- server get code and start session
- close server - you are login
GoogleApi.config.client_id = "123456.apps.googleusercontent.com"
GoogleApi.config.client_secret = "123456123456123456"
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)