Can i use google cloud print using a google service account?

171 Views Asked by At

I cant use OAuth2 authentication for accessing Google cloud print as I can't have a browser redirection for account selection. So I am trying out Google service account for accessing Google cloud print (suggested method for these scenarios). But under the googleapiclient.discovery , I am unable to find a key word for cloud printing. This is the code snippet which I tried.

from google.oauth2 import service_account
import requests


SCOPES = ['https://www.googleapis.com/auth/cloudprint']
SERVICE_ACCOUNT_FILE = 'secret.json'

credentials = service_account.Credentials.from_service_account_file(
        SERVICE_ACCOUNT_FILE, scopes=SCOPES)

sqladmin = googleapiclient.discovery.build('sqladmin', 'v1beta3', credentials=credentials)

I am confused at 2 places in the above code snippet. 1. If the scope provided is valid 2. What is the alternative for argument sqladmin in googleapiclient.discovery.build() function for Google cloud print.

0

There are 0 best solutions below