ory / network

Ory runs a global end-to-end security infrastructure for humans, robots, and servers. We build and use open source software.
Apache License 2.0
80 stars 6 forks source link

Ory Console: Errors in editing/ saving existing OAuth2 clients created using Ory REST API #393

Open anichrelay-bloom opened 1 week ago

anichrelay-bloom commented 1 week ago

Preflight checklist

Ory Network Project

https://wizardly-ganguly-cuxppwjvrz.projects.oryapis.com

Describe the bug

I created OAuth2 clients using the Ory REST APIs successfully but I am facing issues when trying to edit the clients using Ory console. Even if I don't make any changes to an client and hit on Save, I see these two errors:

  1. Audience field and input box turn red, no error message is shown: image

I imagine this is because I am using a non-url string as audience that might be causing some validation errors internally. However, I am able to successfully set the audience as dev-api when using rest api /admin/clients. So, the audience value should also work with Ory console.

  1. If I remove audience field, the second error pops up at bottom of client edit page:
    Unable to decode the request body: json: cannot unmarshal array into Go struct field Client.token_endpoint_auth_signing_alg of type string

    I have set the value using rest api endpoints as : "token_endpoint_auth_signing_alg": "RS256",

Again, I don't see any of these errors while using REST endpoints.

Reproducing the bug

Few ways to reproduce but lets do this:

  1. Create a OAuth2 client using POST/admin/clients endpoint with this body:

    {
    "client_name": "test client3",
    "grant_types": [
        "client_credentials"
    ],
    "response_types": [
        "token"
    ],
    "access_token_strategy": "jwt",
    "skip_consent": true,
    "audience": [
        "dev-api"
    ],
    "scope": "read:all",
    "token_endpoint_auth_method": "client_secret_post",
    "token_endpoint_auth_signing_alg": "RS256",
    "jwt_bearer_grant_access_token_lifespan": "720h",
    "client_credentials_grant_access_token_lifespan": "720h",
    }
  2. Go to ory console -> OAuth2 -> Oauth2 clients -> click on Edit button on newly created client test client3.

  3. Click on Save. Should throw audience error.

  4. Clear audience field and click on save. Now you should see the second error.

Relevant log output

No response

Relevant configuration

No response

Version

latest I suppose

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response

jonas-jonas commented 1 week ago

Thanks for the report. We'll take a look.