Skip to content

Commit f1484b6

Browse files
committed
update : crul command
1 parent cd8fad3 commit f1484b6

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/pages/guides/authentication/ServerToServerAuthentication/implementation.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,52 +90,51 @@ To rotate client secrets through the UI, follow the steps below on the credentia
9090

9191
Once a client secret is deleted, you cannot restore it. So be extra sure you have replaced the old client secret with the new one in all locations.
9292

93-
9493
### Rotating client secrets programmatically
9594

9695
Follow the steps below to rotate client secrets programmatically for the OAuth Server-to-Server credential.
9796

9897
1. Add I/O Management API to your project: This API allows your credential to read, add, and delete its client secrets.
99-
98+
10099
2. Go to the OAuth Server-to-Server credential overview page and grab the URL. For example -
101100

102-
```
101+
```curl
103102
https://developer.adobe.com/console/projects/23294/4566206088344958295/credentials/436084/details/oauthservertoserver
104103
```
105104
106105
3. Grab the value of `org id` and `credential id` from the URL by comparing it to the templated URL below.
107106
108-
```
107+
```curl
109108
https://developer.adobe.com/console/projects/{orgId}/{projectId}/credentials/{credentialId}/details/oauthservertoserver
110109
```
111110
112111
4. Construct the secrets request endpoint by substituting the value of `org id` and `credential id` in the URL below.
113112
114-
```
113+
```curl
115114
https://api.adobe.io/console/organizations/{orgId}/credentials/{credentialId}/secrets
116115
```
117116
118-
```
117+
```curl
119118
https://api.adobe.io/console/organizations/23294/credentials/436084/secrets
120119
```
121120
122121
5. Generate an access token using the existing client secret (see the section on [generating access tokens](#generate-access-tokens)). Make sure to include scopes that the I/O Management API requires:
123122
124-
```
123+
```curl
125124
AdobeID, openid, read_organizations, additional_info.projectedProductContext, additional_info.roles, adobeio_api, read_client_secret, manage_client_secrets
126125
```
127126
128127
6. Call the API to list all existing client secrets. Note: you can grab your `client_id` from the OAuth Server-to-Server credential overview page.
129128
130-
```
129+
```curl
131130
curl -X GET 'https://api.adobe.io/console/organizations/{orgId}/credentials/{credentialId}/secrets' \
132131
-H 'Authorization: Bearer {ACCESS TOKEN GENERATED IN STEP 5}'
133132
-H 'x-api-key: {CLIENT ID FROM STEP 6}'
134133
```
135134
136135
7. Call the API to add another client secret to your credential. The API response contains the `client_secret` that was added and its `uuid`. This `client_secret` will never be returned in plain text by any other API response. However, you can still find it on the Developer Console UI.
137136
138-
```
137+
```curl
139138
curl -X POST 'https://api.adobe.io/console/organizations/{orgId}/credentials/{credentialId}/secrets' \
140139
-H 'Authorization: Bearer {ACCESS TOKEN GENERATED IN STEP 5}'
141140
-H 'x-api-key: {CLIENT ID FROM STEP 6}'
@@ -146,8 +145,8 @@ Follow the steps below to rotate client secrets programmatically for the OAuth S
146145
9. Call the API to list all client secrets for your credential. You can confirm that you have successfully updated the client secret in your applications by comparing the last used timestamps for the secrets. Grab the value of the `uuid` field for your older secret that you wish to delete.
147146
148147
10. Call the API to delete the old client secret from your credential by passing the `uuid` in the URL
149-
150-
```
148+
149+
```curl
151150
curl -X DELETE 'https://api.adobe.io/console/organizations/{orgId}/credentials/{credentialId}/secrets/{uuid from step 9}' \
152151
-H 'Authorization: Bearer {ACCESS TOKEN GENERATED IN STEP 5}'
153152
-H 'x-api-key: {CLIENT ID FROM STEP 6}'

0 commit comments

Comments
 (0)