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

ory patch Error: value for /services/oauth2/config'/strategies/access_token must be valid JSON but got: opaque' #341

Open
3 of 5 tasks
EcBen opened this issue Feb 9, 2024 · 5 comments
Labels
bug Something is not working.

Comments

@EcBen
Copy link

EcBen commented Feb 9, 2024

Preflight checklist

Ory Network Project

No response

Describe the bug

The ory patch command does not work. The examples returned do not work.

Reproducing the bug

Run the patch command:

ory patch oauth2-config project-uuid-here --replace '/strategies/access_token="opaque"'

Get error response:

Usage:
  ory patch oauth2-config [project-id] [flags]

Aliases:
  oauth2-config, oc, hydra-config

Examples:
$ ory patch oauth2-config ecaaa3cb-0730-4ee8-a6df-9553cdfeef89 \
        --replace '/strategies/access_token="jwt"' \
        --add '/ttl/login_consent_request="1h"' \
        --remove '/strategies/scope' \
        --format json-pretty

{
  "oauth2": {
    "client_credentials": {
      "default_grant_allowed_scope": false
    },
    "expose_internal_errors": true,
    "grant": {
      "jwt": {
        "iat_optional": false,
        "jti_optional": false,
        "max_ttl": "720h0m0s"
      }
    }
  },
  // ...
}


Flags:
      --add stringArray       Add a specific key to the configuration
  -f, --file strings          Configuration file(s) (file://config.json, https://example.org/config.yaml, ...) to update the project
      --format string         Set the output format. One of table, json, yaml, json-pretty, jsonpath and jsonpointer. (default "default")
  -h, --help                  help for oauth2-config
  -q, --quiet                 Be quiet with output printing.
      --remove stringArray    Remove a specific key from the configuration
      --replace stringArray   Replace a specific key in the configuration
  -y, --yes                   Confirm all dialogs with yes.

Global Flags:
  -c, --config string   Path to the Ory Network configuration file.

value for /services/oauth2/config'/strategies/access_token must be valid JSON but got: opaque'

Note:

This is running the exact example return, which doesn't work:
runnning:

$ ory patch oauth2-config project-uuid-here --replace '/strategies/access_token="opaque"'

Example shown:

$ ory patch oauth2-config ecaaa3cb-0730-4ee8-a6df-9553cdfeef89 \
        --replace '/strategies/access_token="jwt"'

Relevant log output

No response

Relevant configuration

No response

Version

v0.3.2

On which operating system are you observing this issue?

Windows

In which environment are you deploying?

Ory Network

Additional Context

No response

@EcBen EcBen added the bug Something is not working. label Feb 9, 2024
@EcBen
Copy link
Author

EcBen commented Feb 9, 2024

Similar issue, but different error:
#157

@aeneasr
Copy link
Member

aeneasr commented Feb 10, 2024

It looks like the problem is the syntax here on windows. Are you using cmd or powershell? Basically, the string needs to be correctly escaped, which is probably causing this problem.

@EcBen
Copy link
Author

EcBen commented Feb 13, 2024

@aeneasr I thought it might have something to do with Windows. I'm actually using Cmder on Windows. So I believe that would be just a basic cmd console, not powershell.

@aeneasr
Copy link
Member

aeneasr commented Feb 14, 2024

On Windows it's probably:

ory patch oauth2-config project-uuid-here --replace "/strategies/access_token=\"opaque\""

@EcBen
Copy link
Author

EcBen commented Feb 15, 2024

@aeneasr Yes, that format did work on Windows. Thanks!
It would be nice if the ory --help for this showed the correct format on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

2 participants