Skip to content

Instantly share code, notes, and snippets.

View hiromipaw's full-sized avatar

Silvia hiromipaw

View GitHub Profile
@areina
areina / apitools_github_oauth.lua
Created April 23, 2014 16:01
Apitools middleware to provide a callback endpoint for github oauth
return function(request, next_middleware)
local CLIENT_ID = "foo"
local CLIENT_SECRET = "bar"
local APP_URL = "http://localhost:9000/#overview"
if request.uri == '/callback' then
local session_code = request.args["code"]
local url = "https://github.com/login/oauth/access_token"
local request_body = {
client_id = CLIENT_ID,