Reputation: 21
It is posible to authorize youtube API with multiple scopes once? ( https://www.googleapis.com/auth/yt-analytics.readonly and https://www.googleapis.com/auth/youtube.readonly)
Upvotes: 2
Views: 1608
Reputation: 3320
An example in Python would be:
YOUTUBE_SCOPES = ["https://www.googleapis.com/auth/youtube.upload", "https://www.googleapis.com/auth/youtube.readonly"]
Where you can put any scopes in the array. Then execute:
flow = flow_from_clientsecrets(CLIENT_SECRETS_FILE,
scope=YOUTUBE_SCOPES,
message=MISSING_CLIENT_SECRETS_MESSAGE)
Upvotes: 0
Reputation: 1133
Multiple scopes can be given as a space delimited list.
Per the auth flow documentation
SCOPE Required. A space-delimited list of scopes that identify the resources that
your application could access on the user's behalf. These values determine
which permissions are listed on the consent page that Google displays to the user.
Upvotes: 3
Reputation: 1352
Yes. You can authorize with multiple scopes. If you application can do multiple actions, you would need to add the relevant scopes so that the user can be authenticated and your application can execute the desired actions.
Upvotes: 0