Skip to content

Commit c2086ea

Browse files
alnrclaude
andcommitted
docs: hydra update oauth2-client updates only provided fields
The hydra update oauth2-client and ory update oauth2-client commands now send a partial update built from the flags that were set, instead of replacing the entire client. Update the CLI reference synopses and the OAuth2 clients guide accordingly: the flag-based examples move to the patch section, and the update (replace) section documents --file. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 68499be commit c2086ea

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

docs/cli/ory-update-oauth2-client.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ Update an OAuth 2.0 Client
1515

1616
### Synopsis
1717

18-
This command replaces an OAuth 2.0 Client by its ID. Please be aware that this command replaces the entire client. If only the name flag (-n "my updated app") is provided, the all other fields are updated to their default values.
18+
This command updates an OAuth 2.0 Client by its ID. Only the fields provided as flags are changed; all other fields keep their current values.
19+
20+
To replace the entire client with a new configuration, use the --file flag. Fields missing from the file are reset to their default values.
1921

2022
```
2123
ory update oauth2-client [id] [flags]

docs/hydra/guides/oauth2-clients.mdx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,17 @@ If you use secret rotation, setting a new secret through the update client API c
142142
</TabItem>
143143
<TabItem value="cli" label="Ory CLI">
144144
145+
To replace the entire client, pass a complete client definition from a file. Fields missing from the file are reset to their
146+
default values:
147+
145148
```
146149
ory update oauth2-client --project <project-id> --workspace <workspace-id> {client.id} \
147-
--grant-type authorization_code --grant-type refresh_token --grant-type client_credentials \
148-
--response-type code \
149-
--scope openid --scope offline_access \
150-
--token-endpoint-auth-method client_secret_post \
151-
--redirect-uri https://a-new-callback
150+
--file client.json
152151
```
153152
153+
To change individual fields without touching the rest of the configuration, pass them as flags instead. See
154+
[Patch OAuth2 client](#patch-oauth2-client).
155+
154156
</TabItem>
155157
<TabItem value="sdk" label="Ory SDK">
156158
@@ -188,6 +190,17 @@ If you use secret rotation, setting a new secret through the patch client API cl
188190
3. Click on the **pen symbol** to update the client's configuration.
189191
3. When you are finished, scroll to the top and click **Save**.
190192
193+
</TabItem>
194+
<TabItem value="cli" label="Ory CLI">
195+
196+
Pass only the fields you want to change as flags. All other fields keep their current values:
197+
198+
```
199+
ory update oauth2-client --project <project-id> --workspace <workspace-id> {client.id} \
200+
--scope openid --scope offline_access \
201+
--redirect-uri https://a-new-callback
202+
```
203+
191204
</TabItem>
192205
<TabItem value="sdk" label="Ory SDK">
193206

0 commit comments

Comments
 (0)