Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
state = request.args.get("state") # you should check the state is valid code = request.args.get("code") error = request.args.get("error") url = 'https://www.reddit.com/api/v1/access_token/' data = { 'grant_type': 'authorization_code', 'code': code, 'redirect_uri': 'http://localhost:3000/login/callback' } # See https://github.com/reddit-archive/reddit/wiki/API#rules for UA headers = {'User-agent': ...} r = requests.post(url, data=data, auth=(CLIENT_ID, CLIENT_SECRET), headers=headers)