Skip to content

Instantly share code, notes, and snippets.



Created Jan 19, 2019
What would you like to do?
OAuth callback server
from flask import Flask, request
import requests
import json
app = Flask(__name__)
def callback():
code = request.args.get("code")
data = {
"client_id" : "deadbeef3b147d012f8b",
"client_secret" : "9eeeeeeeeee9999999aaaaaaaabbbbbffff11101",
"code" : code
headers = {
"accept" : "application/json"
r ="", data=data, headers=headers)
res = r.json()
return res.get("access_token")
if __name__ == "__main__":"", port=8182)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.