I have written the following code in Databricks notebook (just the problematic part of it):
# Connection
flow = google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file(
client_secrets_file, scopes)
print(flow)
credentials = flow.run_console()
youtube_analytics = googleapiclient.discovery.build(
api_service_name, api_version, credentials=credentials)
print(youtube_analytics)
# After this password would ask you to visit the url to authorize this application
# Youtube Project wants to access your Google account
I run it, it redirects me to google sign in page, I perform a sign in, get an authorization code, and as you see I am then asked to 'Enter the authorization code: '. The problem is I can't make the entry/input. In my Jupiter notebook it gives me a possibility to enter the auth code just in console output of the cell.
However, with Databricks notebook, it appears to be constantly waiting for the code input. Output is below:
<google_auth_oauthlib.flow.InstalledAppFlow object at 0x7f3b921665b0>
Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=123456789012-2jk0lelmg5m4p5s6c0b284potst9cumd.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyt-analytics.readonly&state=EBizXejyThoJCSszfypDsqczBSN2Tk&prompt=consent&access_type=offline
Enter the authorization code: (*here I can't input the code)