MCPcopy Create free account
hub / github.com/RiotGames/developer-relations / oauth_callback

Function oauth_callback

sample_apps/rso_sample_apps/python/main.py:50–68  ·  view source on GitHub ↗
(code: str)

Source from the content-addressed store, hash-verified

48
49@app.get(CONFIG["APP_CALLBACK_PATH"], response_class=HTMLResponse)
50def oauth_callback(code: str):
51 resp = requests.post(CONFIG['TOKEN_URL'],
52 auth=HTTPBasicAuth(CONFIG["RSO_CLIENT_ID"],
53 CONFIG["RSO_CLIENT_SECRET"]),
54 data={
55 "grant_type": "authorization_code",
56 "code": code,
57 "redirect_uri": CONFIG["APP_CALLBACK_URL"]
58 },
59 timeout=TIMEOUT
60 )
61
62 query_string = ""
63
64 if resp.json() is not None:
65 for k, v in resp.json().items():
66 query_string += f'{k}={v}&'
67
68 return f"""<script>window.location.href = "/show-data/?{query_string}";</script>"""
69
70
71def json2table(json):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected