Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with scope value #140

Open
anjalipowells opened this issue Apr 25, 2023 · 1 comment
Open

Issue with scope value #140

anjalipowells opened this issue Apr 25, 2023 · 1 comment
Labels
triage Needs triage

Comments

@anjalipowells
Copy link

anjalipowells commented Apr 25, 2023

Problem
When I try to create a client using Python SDK, I get a warning in scope value. If I follow the warning and fix it, I get error in scope value
Warning: Scope has changed from “manage_products:” to “manage_products:{project_key} view_products:{project_key}.
Error: Permissions exceeded. Only the following permissions can be requested: manage_products

Using the below code to connect:

client = Client(
    client_id="my-client-id",
    client_secret="my-client-secret",
    # scope=["manage_products:{project-key}"],
    scope=["manage_products:{project-key}", "view_products:{project-key}"],
    url="https://api.{region}.gcp.commercetools.com",
    token_url="https://auth.{region}.gcp.commercetools.com",
)

client = Client()

product = (
    client
    .with_project_key("project_key")
    .products()
    .with_id({guid_Id})
    .get())
@demeyerthom demeyerthom added the triage Needs triage label Aug 6, 2023
@dimentii
Copy link

dimentii commented Oct 4, 2023

Faced same issue
Fixed by adding OAUTHLIB_RELAX_TOKEN_SCOPE environment variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs triage
Projects
None yet
Development

No branches or pull requests

3 participants