Spaces:
Runtime error
Runtime error
File size: 448 Bytes
027a338 3ac7c08 3cd8a78 42dc391 3cd8a78 027a338 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import google_auth_oauthlib.flow
import logging
logging.basicConfig(level=logging.INFO)
def get_oauth_url(SCOPES, redirect_url):
flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file(
"credentials.json", scopes=SCOPES
)
flow.redirect_uri = redirect_url
authorization_url, state = flow.authorization_url(
access_type="offline",
include_granted_scopes="true",
)
return authorization_url
|