Skip to content

Instantly share code, notes, and snippets.

@ruseel
ruseel / get_oauth2_token.py
Last active October 11, 2017 05:18 — forked from clarketm/get_oauth2_token.py
How to get Google OAuth 2.0 access token in console using the Python API
#!/usr/bin/env python
'''
This script will attempt to open your webbrowser,
perform OAuth 2.0 authentication and print your access token.
To install dependencies from PyPI:
$ pip install oauth2client
Then run this script:
#!/bin/bash
# chkconfig: 2345 95 20
# description: This application was developed by me and is tested on this server
# processname: my_app
#
# Tomcat 8 start/stop/status init.d script
# Initially forked from: https://gist.github.com/valotas/1000094
# @author: Miglen Evlogiev <bash@miglen.com>
#
# Release updates: