Error with Update Client

I’m using the Okta client-management collection; the Update Client item fails with

{
“error”: “invalid_client_metadata”,
“error_description”: “‘client_id’ cannot be modified.”
}

I’m not trying to modify client_id - I get the same failure with and without client_id specified in the body.

I have to assume that this essential API endpoint works, but have no idea what might be wrong.

here’s the full request (redacted of course) - as you can see, not an adventurous stretch. I like to see the bare essentials working before I mess with the request. I’ve tried a great many variants on this - exact same failure every time.

curl -X PUT
https://dev-nnnmmm.oktapreview.com/oauth2/v1/clients/
-H ‘Accept: application/json’
-H ‘Authorization: SSWS _______’
-H ‘Content-Type: application/json’
-H ‘cache-control: no-cache’
-d ‘{
“client_name”: “here is your new name”,
“client_uri”: “URLhere”,
“logo_uri”: “URLhere”,
“application_type”: “web”,
“redirect_uris”: [
“URLhere”
],
“post_logout_redirect_uris”: [
“URLhere”
],
“response_types”: [
“id_token”,
“code”
],
“grant_types”: [
“authorization_code”
],
“token_endpoint_auth_method”: “client_secret_post”,
“initiate_login_uri”: “URLhere”
}’

Hi @panderson_mule

When doing a PUT request on /oauth2/v1/clients/${clientId}, the OIDC client’s client_id needs to be also sent in the request body as exemplified here.

If the client ID is not sent in the body, the request is seen as trying to change the client ID of the app which is a read only attribute and, as such, Okta returns the error message 'client_id' cannot be modified..

We are getting this using the Apps API. Trying to do a put to updated existing app. Tried adding the client_id to the put body as well as this suggests and still get the error. This is happening in a dev tenant: dev-54188342.

Thanks
Tom

I too got the same error.
Then I found out It says “Note: All properties must be specified when updating an app. Delta updates are not supported.” in this Apps API page Apps | Okta Developer .
Once I sent back the output of Get App with my changes, it worked

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.