Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Invalid Scope Error

Hello,

I have created an API Product through the gcp console and set the "Allowed OAuth scopes" as "courses:read,modules:read".

I am attempting to create a developer app using the management API. I am sending this as my request body:

const body = {
name: "redacted",
scopes: ["courses:read", "modules:read"],
status: "approved",
apiProducts: ["redacted"],
};

I am getting the following error as my response. Is there some nuance I am missing or is this a known apigee management api bug? I am passing valid scopes.

 

error: {
code: 400,
message: "Invalid scopes. Scopes must be contained in [modules:read, courses:read]",
status: "INVALID_ARGUMENT",
details: [
{
"@type": "type.googleapis.com/google.rpc.PreconditionFailure",
violations: [
{
type: "keymanagement.service.InvalidScopes",
subject: "[2002:a17:531:99cc::]:4116:gece10-20020a057110324a00b0021a50681eb5:9805:349579:99732193",
description: "Invalid scopes. Scopes must be contained in [modules:read, courses:read]"
}
]
}, {
"@type": "type.googleapis.com/google.rpc.RequestInfo",
requestId: "4204281115099135940"
}
]
}
0 2 1,415
2 REPLIES 2