You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[TokenVault](https://auth0.com/docs/secure/tokens/token-vault) lets you exchange an Auth0 token for a federated identity provider's access token, so your application can call the provider's APIs on the user's behalf. The connection must have Token Vault enabled, and because this exchange requires a private client, the `AuthAPI` instance must be configured with a client secret or client assertion.
332
+
333
+
### Exchange a refresh token
334
+
335
+
Use `getTokenForConnectionWithRefreshToken()` to exchange an Auth0 refresh token for the federated provider's access token:
When a user has multiple accounts on the same connection, pass their ID within the identity provider as the `loginHint` (the final argument). Pass `null` to omit it:
359
+
360
+
```java
361
+
TokenHolder result = auth.getTokenForConnectionWithRefreshToken("google-oauth2", "{REFRESH_TOKEN}", "{GOOGLE_USER_ID}")
362
+
.execute()
363
+
.getBody();
364
+
```
365
+
366
+
### Exchanging other token types
367
+
368
+
For full control over the subject token type, use the generic `getTokenForConnection()` and supply the `subject_token_type` URN yourself:
369
+
370
+
```java
371
+
TokenHolder result = auth.getTokenForConnection(
372
+
"google-oauth2",
373
+
"{SUBJECT_TOKEN}",
374
+
"urn:ietf:params:oauth:token-type:refresh_token",
375
+
"{GOOGLE_USER_ID}")
376
+
.execute()
377
+
.getBody();
378
+
```
379
+
328
380
## Logging
329
381
330
382
The SDK is silent by default. You can enable logging to see HTTP requests and responses, which is useful for debugging.
Copy file name to clipboardExpand all lines: reference.md
+57-1Lines changed: 57 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1302,7 +1302,7 @@ client.clients().list(
1302
1302
<dl>
1303
1303
<dd>
1304
1304
1305
-
**externalClientId:**`Optional<String>` — Optional filter by the <ahref="https://www.ietf.org/archive/id/draft-ietf-oauth-client-id-metadata-document-04.html">Client ID Metadata Document</a> URI for CIMD-registered clients.
1305
+
**externalClientId:**`Optional<String>` — Optional filter by the <ahref="https://drafts.oauth.net/draft-ietf-oauth-client-id-metadata-document/draft-ietf-oauth-client-id-metadata-document.html">Client ID Metadata Document</a> URI for CIMD-registered clients.
1306
1306
1307
1307
</dd>
1308
1308
</dl>
@@ -1786,6 +1786,14 @@ See https://auth0.com/docs/secure/security-guidance/measures-against-app-imperso
0 commit comments