Skip to content

Commit 718ee59

Browse files
author
Amanda VS
authored
Update Nav per feedback from Protocols (#10430)
* Update Nav per feedback from Protocols * Update _revoke-refresh-token.md Fixed
1 parent e1e3d40 commit 718ee59

File tree

4 files changed

+176
-177
lines changed

4 files changed

+176
-177
lines changed

articles/api/authentication/api-authz/_refresh-token.md

+2-177
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Content-Type: application/json
5757

5858
Use this endpoint to refresh an <dfn data-key="access-token">Access Token</dfn> using the <dfn data-key="refresh-token">Refresh Token</dfn> you got during authorization.
5959

60-
### Request Parameters
60+
## Request Parameters
6161

6262
| Parameter | Description |
6363
|:-----------------|:------------|
@@ -67,181 +67,6 @@ Use this endpoint to refresh an <dfn data-key="access-token">Access Token</dfn>
6767
| `refresh_token` <br/><span class="label label-danger">Required</span> | The refresh token to use. |
6868
| `scope` | A space-delimited list of requested scope permissions. If not sent, the original scopes will be used; otherwise you can request a reduced set of scopes. Note that this must be URL encoded. |
6969

70-
### Learn More
71-
72-
- [Refresh Tokens](/tokens/concepts/refresh-tokens)
73-
74-
## Token Exchange for Native Social
75-
76-
```http
77-
POST https://${account.namespace}/oauth/token
78-
Content-Type: application/x-www-form-urlencoded
79-
80-
grant_type=urn:ietf:params:oauth:grant-type:token-exchange&subject_token=SUBJECT_TOKEN&subject_token_type=SUBJECT_TOKEN_TYPE&client_id=${account.clientId}&audience=API_IDENTIFIER&scope=SCOPE
81-
```
82-
83-
```shell
84-
curl --request POST \
85-
--url 'https://${account.namespace}/oauth/token' \
86-
--header 'content-type: application/x-www-form-urlencoded' \
87-
--data 'grant_type=urn:ietf:params:oauth:grant-type:token-exchange&subject_token=SUBJECT_TOKEN&subject_token_type=SUBJECT_TOKEN_TYPE&client_id=${account.clientId}&audience=API_IDENTIFIER&scope=SCOPE'
88-
}'
89-
```
90-
91-
```javascript
92-
var request = require("request");
93-
94-
var options = { method: 'POST',
95-
url: 'https://${account.namespace}/oauth/token',
96-
headers: { 'content-type': 'application/x-www-form-urlencoded' },
97-
form:
98-
{ grant_type: 'urn:ietf:params:oauth:grant-type:token-exchange',
99-
subject_token: 'SUBJECT_TOKEN',
100-
subject_token_type: 'SUBJECT_TOKEN_TYPE',
101-
client_id: '${account.clientId}',
102-
audience: 'API_IDENTIFIER',
103-
scope: 'SCOPE',
104-
};
105-
106-
request(options, function (error, response, body) {
107-
if (error) throw new Error(error);
108-
109-
console.log(body);
110-
});
111-
```
112-
113-
> RESPONSE SAMPLE:
114-
115-
```JSON
116-
HTTP/1.1 200 OK
117-
Content-Type: application/json
118-
{
119-
"access_token": "eyJz93a...k4laUWw",
120-
"id_token": "eyJ...0NE",
121-
"refresh_token": "eyJ...MoQ",
122-
"expires_in":86400,
123-
"token_type":"Bearer"
124-
}
125-
```
126-
127-
<%= include('../../../_includes/_http-method', {
128-
"http_badge": "badge-success",
129-
"http_method": "POST",
130-
"path": "/oauth/token",
131-
"link": "#token-exchange-native-social"
132-
}) %>
133-
134-
:::warning
135-
This flow is intended for use with native social interactions **only**. Use of this flow outside of a native social setting is highly discouraged.
136-
:::
137-
138-
When a non-browser-based solution (such as a mobile platform's SDK) authenticates the user, the authentication will commonly result in artifacts being returned to application code. In such situations, this grant type allows for the Auth0 platform to accept artifacts from trusted sources and issue tokens in response. In this way, apps making use of non-browser-based authentication mechanisms (as are common in native apps) can still retrieve Auth0 tokens without asking for further user interaction.
139-
140-
Artifacts returned by this flow (and the contents thereof) will be determined by the `subject_token_type` and the tenant's configuration settings.
141-
142-
### Request Parameters
143-
144-
| Parameter | Description |
145-
|:-----------------|:------------|
146-
| `grant_type` <br/><span class="label label-danger">Required</span> | Denotes the flow you are using. For Token Exchange for Native Social, use `urn:ietf:params:oauth:grant-type:token-exchange`. |
147-
| `subject_token` <br/><span class="label label-danger">Required</span> | Externally-issued identity artifact representing the user. |
148-
| `subject_token_type` <br/><span class="label label-danger">Required</span> | Identifier that indicates the type of `subject_token`. |
149-
| `client_id` <br/><span class="label label-danger">Required</span> | Your application's Client ID. |
150-
| `audience` | The unique identifier of the target API you want to access. |
151-
| `scope` | String value of the different <dfn data-key="scope">scopes</dfn> the application is requesting. Multiple scopes are separated with whitespace. |
152-
| `user_profile` <br/><span class="label label-info">Only For `apple-authz-code`</span> | Optional element used for native iOS interactions for which profile updates can occur. Expected parameter value will be JSON in the form of: `{ name: { firstName: 'John', lastName: 'Smith }}` |
153-
154-
### Request Parameters
155-
156-
| Parameter | Description |
157-
|:-----------------|:------------|
158-
| `auth0-forwarded-for` | End user IP as a string value. Set this if you want brute-force protection to work in server-side scenarios. To learn more about how and when to use this header, read [Using resource owner password from server-side](/api-auth/tutorials/using-resource-owner-password-from-server-side). |
159-
160-
### Remarks
161-
162-
- The <dfn data-key="scope">scopes</dfn> issued to the application may differ from the requested scopes. In this case, a `scope` parameter will be included in the response JSON.
163-
- If you don't request specific scopes, all scopes defined for the audience will be returned due to the implied trust to the application in this grant. You can customize the scopes returned in a rule. To learn more, read [Calling APIs from Highly Trusted Applications](/api-auth/grant/password).
164-
165-
### Learn More
166-
- [Add Sign In with Apple to Native iOS Apps](/connections/apple-siwa/add-siwa-to-native-app)
167-
- [iOS Swift - Sign In with Apple Quickstart](/quickstart/native/ios-swift-siwa)
168-
169-
## Revoke Refresh Token
170-
171-
```http
172-
POST https://${account.namespace}/oauth/revoke
173-
Content-Type: application/json
174-
{
175-
"client_id": "${account.clientId}",
176-
"client_secret": "YOUR_CLIENT_SECRET",
177-
"token": "YOUR_REFRESH_TOKEN",
178-
}
179-
```
180-
181-
```shell
182-
curl --request POST \
183-
--url 'https://${account.namespace}/oauth/revoke' \
184-
--header 'content-type: application/json' \
185-
--data '{ "client_id": "${account.clientId}", "client_secret": "YOUR_CLIENT_SECRET", "token": "YOUR_REFRESH_TOKEN" }'
186-
```
187-
188-
```javascript
189-
var request = require("request");
190-
191-
var options = { method: 'POST',
192-
url: 'https://${account.namespace}/oauth/revoke',
193-
headers: { 'content-type': 'application/json' },
194-
body:
195-
{ client_id: '${account.clientId}',
196-
client_secret: 'YOUR_CLIENT_SECRET',
197-
token: 'YOUR_REFRESH_TOKEN' },
198-
json: true };
199-
200-
request(options, function (error, response, body) {
201-
if (error) throw new Error(error);
202-
203-
console.log(body);
204-
});
205-
```
206-
207-
> RESPONSE SAMPLE:
208-
209-
```JSON
210-
HTTP/1.1 200 OK
211-
(empty-response-body)
212-
```
213-
214-
<%= include('../../../_includes/_http-method', {
215-
"http_badge": "badge-success",
216-
"http_method": "POST",
217-
"path": "/oauth/revoke",
218-
"link": "#revoke-refresh-token"
219-
}) %>
220-
221-
Use this endpoint to invalidate a <dfn data-key="refresh-token">Refresh Token</dfn> if it has been compromised.
222-
223-
The behaviour of this endpoint depends on the state of the [Refresh Token Revocation Deletes Grant](https://auth0.com/docs/tokens/refresh-tokens/revoke-refresh-tokens#refresh-tokens-and-grants) toggle.
224-
If this toggle is enabled, then each revocation request invalidates not only the specific token, but all other tokens based on the same authorization grant. This means that **all Refresh Tokens that have been issued for the same user, application, and <dfn data-key="audience">audience</dfn> will be revoked**.
225-
If this toggle is disabled, then only the refresh token is revoked, while the grant is left intact.
226-
227-
### Request Parameters
228-
229-
| Parameter | Description |
230-
|:-----------------|:------------|
231-
| `client_id` <br/><span class="label label-danger">Required</span> | The `client_id` of your application. |
232-
| `client_assertion`| A JWT containing a signed assertion with your application credentials. Required when Private Key JWT is your application authentication method.|
233-
| `client_assertion_type`| The value is `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`. Required when Private Key JWT is the application authentication method.|
234-
| `client_secret` | The `client_secret` of your application. Required when Client Secret Basic or Client Secret Post is the application authentication method. Specifically required for Regular Web Applications **only**. |
235-
| `token` <br/><span class="label label-danger">Required</span> | The Refresh Token you want to revoke. |
236-
237-
### Remarks
238-
239-
- For non-confidential applications that cannot keep the Client Secret safe (for example, native apps), the endpoint supports passing no Client Secret but the application itself must have the property `tokenEndpointAuthMethod` set to `none`. You can do this either from the UI ([Dashboard > Applications > Application Settings](${manage_url}/#/applications)) or using the [Management API](/api/management/v2#!/Applications/patch_applications_by_id).
240-
241-
### Error Codes
242-
243-
For the complete error code reference for this endpoint refer to [Errors > POST /oauth/revoke](#post-oauth-revoke).
244-
245-
### Learn More
70+
## Learn More
24671

24772
- [Refresh Tokens](/tokens/concepts/refresh-tokens)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Revoke Refresh Token
2+
3+
```http
4+
POST https://${account.namespace}/oauth/revoke
5+
Content-Type: application/json
6+
{
7+
"client_id": "${account.clientId}",
8+
"client_secret": "YOUR_CLIENT_SECRET",
9+
"token": "YOUR_REFRESH_TOKEN",
10+
}
11+
```
12+
13+
```shell
14+
curl --request POST \
15+
--url 'https://${account.namespace}/oauth/revoke' \
16+
--header 'content-type: application/json' \
17+
--data '{ "client_id": "${account.clientId}", "client_secret": "YOUR_CLIENT_SECRET", "token": "YOUR_REFRESH_TOKEN" }'
18+
```
19+
20+
```javascript
21+
var request = require("request");
22+
23+
var options = { method: 'POST',
24+
url: 'https://${account.namespace}/oauth/revoke',
25+
headers: { 'content-type': 'application/json' },
26+
body:
27+
{ client_id: '${account.clientId}',
28+
client_secret: 'YOUR_CLIENT_SECRET',
29+
token: 'YOUR_REFRESH_TOKEN' },
30+
json: true };
31+
32+
request(options, function (error, response, body) {
33+
if (error) throw new Error(error);
34+
35+
console.log(body);
36+
});
37+
```
38+
39+
> RESPONSE SAMPLE:
40+
41+
```JSON
42+
HTTP/1.1 200 OK
43+
(empty-response-body)
44+
```
45+
46+
<%= include('../../../_includes/_http-method', {
47+
"http_badge": "badge-success",
48+
"http_method": "POST",
49+
"path": "/oauth/revoke",
50+
"link": "#revoke-refresh-token"
51+
}) %>
52+
53+
Use this endpoint to invalidate a <dfn data-key="refresh-token">Refresh Token</dfn> if it has been compromised.
54+
55+
The behaviour of this endpoint depends on the state of the [Refresh Token Revocation Deletes Grant](https://auth0.com/docs/tokens/refresh-tokens/revoke-refresh-tokens#refresh-tokens-and-grants) toggle.
56+
If this toggle is enabled, then each revocation request invalidates not only the specific token, but all other tokens based on the same authorization grant. This means that **all Refresh Tokens that have been issued for the same user, application, and <dfn data-key="audience">audience</dfn> will be revoked**.
57+
If this toggle is disabled, then only the refresh token is revoked, while the grant is left intact.
58+
59+
## Request Parameters
60+
61+
| Parameter | Description |
62+
|:-----------------|:------------|
63+
| `client_id` <br/><span class="label label-danger">Required</span> | The `client_id` of your application. |
64+
| `client_assertion`| A JWT containing a signed assertion with your application credentials. Required when Private Key JWT is the application authentication method.|
65+
| `client_assertion_type`| The value is `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`. Required when Private Key JWT is the application authentication method.|
66+
| `client_secret` | The `client_secret` of your application. Required when Client Secret Basic or Client Secret Post is the application authentication method. Specifically required for Regular Web Applications **only**. |
67+
| `token` <br/><span class="label label-danger">Required</span> | The Refresh Token you want to revoke. |
68+
69+
## Remarks
70+
71+
- For non-confidential applications that cannot keep the Client Secret safe (for example, native apps), the endpoint supports passing no Client Secret but the application itself must have the property `tokenEndpointAuthMethod` set to `none`. You can do this either from the UI ([Dashboard > Applications > Application Settings](${manage_url}/#/applications)) or using the [Management API](/api/management/v2#!/Applications/patch_applications_by_id).
72+
73+
## Error Codes
74+
75+
For the complete error code reference for this endpoint, refer to [Errors > POST /oauth/revoke](#post-oauth-revoke).
76+
77+
## Learn More
78+
79+
- [Refresh Tokens](/tokens/concepts/refresh-tokens)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Token Exchange for Native Social
2+
3+
```http
4+
POST https://${account.namespace}/oauth/token
5+
Content-Type: application/x-www-form-urlencoded
6+
7+
grant_type=urn:ietf:params:oauth:grant-type:token-exchange&subject_token=SUBJECT_TOKEN&subject_token_type=SUBJECT_TOKEN_TYPE&client_id=${account.clientId}&audience=API_IDENTIFIER&scope=SCOPE
8+
```
9+
10+
```shell
11+
curl --request POST \
12+
--url 'https://${account.namespace}/oauth/token' \
13+
--header 'content-type: application/x-www-form-urlencoded' \
14+
--data 'grant_type=urn:ietf:params:oauth:grant-type:token-exchange&subject_token=SUBJECT_TOKEN&subject_token_type=SUBJECT_TOKEN_TYPE&client_id=${account.clientId}&audience=API_IDENTIFIER&scope=SCOPE'
15+
}'
16+
```
17+
18+
```javascript
19+
var request = require("request");
20+
21+
var options = { method: 'POST',
22+
url: 'https://${account.namespace}/oauth/token',
23+
headers: { 'content-type': 'application/x-www-form-urlencoded' },
24+
form:
25+
{ grant_type: 'urn:ietf:params:oauth:grant-type:token-exchange',
26+
subject_token: 'SUBJECT_TOKEN',
27+
subject_token_type: 'SUBJECT_TOKEN_TYPE',
28+
client_id: '${account.clientId}',
29+
audience: 'API_IDENTIFIER',
30+
scope: 'SCOPE',
31+
};
32+
33+
request(options, function (error, response, body) {
34+
if (error) throw new Error(error);
35+
36+
console.log(body);
37+
});
38+
```
39+
40+
> RESPONSE SAMPLE:
41+
42+
```JSON
43+
HTTP/1.1 200 OK
44+
Content-Type: application/json
45+
{
46+
"access_token": "eyJz93a...k4laUWw",
47+
"id_token": "eyJ...0NE",
48+
"refresh_token": "eyJ...MoQ",
49+
"expires_in":86400,
50+
"token_type":"Bearer"
51+
}
52+
```
53+
54+
<%= include('../../../_includes/_http-method', {
55+
"http_badge": "badge-success",
56+
"http_method": "POST",
57+
"path": "/oauth/token",
58+
"link": "#token-exchange-native-social"
59+
}) %>
60+
61+
:::warning
62+
This flow is intended for use with native social interactions **only**. Use of this flow outside of a native social setting is highly discouraged.
63+
:::
64+
65+
When a non-browser-based solution (such as a mobile platform's SDK) authenticates the user, the authentication will commonly result in artifacts being returned to application code. In such situations, this grant type allows for the Auth0 platform to accept artifacts from trusted sources and issue tokens in response. In this way, apps making use of non-browser-based authentication mechanisms (as are common in native apps) can still retrieve Auth0 tokens without asking for further user interaction.
66+
67+
Artifacts returned by this flow (and the contents thereof) will be determined by the `subject_token_type` and the tenant's configuration settings.
68+
69+
## Request Parameters
70+
71+
| Parameter | Description |
72+
|:-----------------|:------------|
73+
| `auth0-forwarded-for` | End user IP as a string value. Set this if you want brute-force protection to work in server-side scenarios. To learn more about how and when to use this header, read [Using resource owner password from server-side](/api-auth/tutorials/using-resource-owner-password-from-server-side). |
74+
| `grant_type` <br/><span class="label label-danger">Required</span> | Denotes the flow you are using. For Token Exchange for Native Social, use `urn:ietf:params:oauth:grant-type:token-exchange`. |
75+
| `subject_token` <br/><span class="label label-danger">Required</span> | Externally-issued identity artifact representing the user. |
76+
| `subject_token_type` <br/><span class="label label-danger">Required</span> | Identifier that indicates the type of `subject_token`. |
77+
| `client_id` <br/><span class="label label-danger">Required</span> | Your application's Client ID. |
78+
| `audience` | The unique identifier of the target API you want to access. |
79+
| `scope` | String value of the different <dfn data-key="scope">scopes</dfn> the application is requesting. Multiple scopes are separated with whitespace. |
80+
| `user_profile` <br/><span class="label label-info">Only For `apple-authz-code`</span> | Optional element used for native iOS interactions for which profile updates can occur. Expected parameter value will be JSON in the form of: `{ name: { firstName: 'John', lastName: 'Smith }}` |
81+
82+
## Remarks
83+
84+
- The <dfn data-key="scope">scopes</dfn> issued to the application may differ from the requested scopes. In this case, a `scope` parameter will be included in the response JSON.
85+
- If you don't request specific scopes, all scopes defined for the audience will be returned due to the implied trust to the application in this grant. You can customize the scopes returned in a rule. To learn more, read [Calling APIs from Highly Trusted Applications](/api-auth/grant/password).
86+
87+
## Learn More
88+
- [Add Sign In with Apple to Native iOS Apps](/connections/apple-siwa/add-siwa-to-native-app)
89+
- [iOS Swift - Sign In with Apple Quickstart](/quickstart/native/ios-swift-siwa)

articles/api/authentication/index.md

+6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ contentType:
7878
<div class="api-section" data-section="api-authz">
7979
<%= include('./api-authz/_refresh-token') %>
8080
</div>
81+
<div class="api-section" data-section="api-authz">
82+
<%= include('./api-authz/_revoke-refresh-token') %>
83+
</div>
84+
<div class="api-section" data-section="api-authz">
85+
<%= include('./api-authz/_token-exchange-native-social') %>
86+
</div>
8187

8288
<span data-section-label="legacy">Legacy</span>
8389
<div class="api-section" data-section="legacy">

0 commit comments

Comments
 (0)