close

[Solved] ValueError: Client secrets must be for a web or installed app

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error ValueError: Client secrets must be for a web or installed app in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How ValueError: Client secrets must be for a web or installed app Error Occurs?

Today I get the following error ValueError: Client secrets must be for a web or installed app in python.

How To Solve ValueError: Client secrets must be for a web or installed app Error ?

  1. How To Solve ValueError: Client secrets must be for a web or installed app Error ?

    To Solve ValueError: Client secrets must be for a web or installed app Error The problem was that I was using the json generated under Service account keys Manage service accounts and not the one under OAuth 2.0 client IDs.

  2. ValueError: Client secrets must be for a web or installed app

    To Solve ValueError: Client secrets must be for a web or installed app Error The problem was that I was using the json generated under Service account keys Manage service accounts and not the one under OAuth 2.0 client IDs.

Solution 1

The problem was that I was using the json generated under Service account keys Manage service accounts and not the one under OAuth 2.0 client IDs.

Solution 2


For anyone coming here because they would like to actually connect to the GCP calendar API via a service-account and not this Oauth2 client id, create the creds object in the original example as follows:

from google.oauth2 import service_account

SCOPES = ['https://www.googleapis.com/auth/sqlservice.admin']
SERVICE_ACCOUNT_FILE = '/path/to/service.json'

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

Assuming the service-account is configured with the correct access, this will access the calendar without prompting user for confirmation.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read