I am building a django application which uses OAuth to get Google drive access. However when I run the flow to get the credentials, the OAuth screen opens in another tab which diverts the user to another window. How do I make the OAuth appear in a popup window and close when authentication is done ?
flow = client.flow_from_clientsecrets(CLIENT_SECRET_FILE, SCOPES)
flow.user_agent = APPLICATION_NAME
if flags:
credentials = tools.run_flow(flow, store, flags)
else:
credentials = tools.run(flow, store)
print('Storing credentials to ' + credential_path)
I believe the tools.run_flow is the method that calls the OAuth screen in another tab.
Thanks !