diff --git a/.version b/.version index ed51b084..1f38bc0e 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -v2.9.0 \ No newline at end of file +v2.10.0 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ac4f81e..76038178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## [v2.10.0](https://github.com/auth0/auth0-react/tree/v2.10.0) (2025-12-05) +[Full Changelog](https://github.com/auth0/auth0-react/compare/v2.9.0...v2.10.0) + +**Added** +- feat: add custom token exchange support [\#928](https://github.com/auth0/auth0-react/pull/928) ([gyaneshgouraw-okta](https://github.com/gyaneshgouraw-okta)) + ## [v2.9.0](https://github.com/auth0/auth0-react/tree/v2.9.0) (2025-11-18) [Full Changelog](https://github.com/auth0/auth0-react/compare/v2.8.0...v2.9.0) diff --git a/docs/assets/hierarchy.js b/docs/assets/hierarchy.js index f7ea4550..6b198bfe 100644 --- a/docs/assets/hierarchy.js +++ b/docs/assets/hierarchy.js @@ -1 +1 @@ -window.hierarchyData = "eJyVlMtOwzAQRf9l1gaS2E5IdqgghFQeKkUsqi4sd9pYpHawnRXqv6O0ArkvHFaRnOOcuZ5xvsAa4x1UM56VhNKEZDSfE7C4bFB6ZbSD6gsymvcPLdYIFbyYtmvHZqX0c7tDCHwovYAq4zmBzjZQgdIe7VJIdFdH/GXt1w0QkI1wDirwbnHRf+Did1P/slbNwqKGapaxdL4hkLE0qOIe/dR8oH5Xvt4ahhVzbtuAmjYEKE2CEh5GQtYYEe6g/0amrOwjU1YGvrGRonn1xooV7qvT7PpHvTWguzqCz5awW+hteRHYpmqNpvN31hr7lyjkIo69iIzxbcQy7OrjUkzws1MWF1HxIRsPyNLycI5HQktsmgG6E/gAI+OHxqHnegQPsBXhWd50vkbtlRT9hEd9J/C4kSd73VPOKb2a4NKiq7f3LN7FM3sGuLNy73+g0SoZ9YXcf8aV5gWhZUpYWhJWpIQnKeGckzwp+jHmPGz0m8Pb1rRPRkuMVnQEx6PnSXhTR0ZrlPGJCrmYY7P5Bup+Bu0=" \ No newline at end of file +window.hierarchyData = "eJyVlMtOwzAQRf9l1i5Qv5JmhwpCSLzEQywqFpY7bSxSO9jOCvXfUVqB3JbisIrkHOfM9YzzCd65GKCaCSYJYwWhnL0R8LhoUEfjbIDqEyhn/cOqFUIFD67t2hu3NPa+3SIE3o2dQ0WFJND5BiowNqJfKI3h9IA/qeOqAQK6USFABTHMR/0HRj+b+pe1aeYeLVQzysu3NQHKy6SKK4zP7h3tq4n1xjCsmGPbBtS0JsBYkZRwPVW6xoxwC/03MhOyj8yETHw3TqvmKTqvlrirHtPyW70xYDg9gI+WsF3obQVPbM9mha6Ll947/5co5TKOnYhc0E3ESdrV24V6xI/OeJxnxftsPiCncn+Op8pqbJoBul/wAUZB941Dz/UAHmAr0rM872KNNhqt+gnP+n7B80ZxttM9E4Kxy0dceAz15p7lu3hkzwA3kzv/A4ve6Kwv5f4zrqzghE1KwqkkvCiJOCuJkJTIMe/HWMi00S8BL1rX3jmrMVvRAZyPLsfpTZ06a1HnJyrlco71+gtvAAcT" \ No newline at end of file diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css index 7034103c..2d9bb903 100644 --- a/docs/assets/highlight.css +++ b/docs/assets/highlight.css @@ -27,6 +27,8 @@ --dark-hl-12: #569CD6; --light-hl-13: #098658; --dark-hl-13: #B5CEA8; + --light-hl-14: #000000; + --dark-hl-14: #C8C8C8; --light-code-background: #FFFFFF; --dark-code-background: #1E1E1E; } @@ -46,6 +48,7 @@ --hl-11: var(--light-hl-11); --hl-12: var(--light-hl-12); --hl-13: var(--light-hl-13); + --hl-14: var(--light-hl-14); --code-background: var(--light-code-background); } } @@ -64,6 +67,7 @@ --hl-11: var(--dark-hl-11); --hl-12: var(--dark-hl-12); --hl-13: var(--dark-hl-13); + --hl-14: var(--dark-hl-14); --code-background: var(--dark-code-background); } } @@ -82,6 +86,7 @@ --hl-11: var(--light-hl-11); --hl-12: var(--light-hl-12); --hl-13: var(--light-hl-13); + --hl-14: var(--light-hl-14); --code-background: var(--light-code-background); } @@ -100,6 +105,7 @@ --hl-11: var(--dark-hl-11); --hl-12: var(--dark-hl-12); --hl-13: var(--dark-hl-13); + --hl-14: var(--dark-hl-14); --code-background: var(--dark-code-background); } @@ -117,4 +123,5 @@ .hl-11 { color: var(--hl-11); } .hl-12 { color: var(--hl-12); } .hl-13 { color: var(--hl-13); } +.hl-14 { color: var(--hl-14); } pre, code { background: var(--code-background); } diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index cbaa13f3..d8abc43f 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "eJylll1v2jAUhv+Lr+nasrXbuKvYh5DoioCqF9MuPOdArAbbs52ubNp/n5IQEscfiZxLOK+fx0nso/P9L9LwqtEMrUEJzhRsjwLQBAmsUzRDwPKDumzX3qT6kKEJeqYsQbMPE0QyrBSaIa2SC6ou4FWDZDhD/yZn9l2uU2CaEqwpZ5+l5LJRlOtBXTpCput6Osw254wB0R5NuxrH/woMJCUefrsax1+wezhweZxjkoItMMpxhiUnONtoLvEePBYrEme63+E1/MqphMTzvrqJSA9VirL9GnYSVLrlz+A7Zr5knPehOLUeU1Oz2C3CiotczDEjkGXel+QIxe23BG3pAXjuuyBWJM4UloznPyr4JLj4xhkBj8SKRJvc8EhecSyu5pwVPxdMg9xh0rqBtP6raolW0pROb2676JXkLzQB+SCKRqr85E6wD8wl/VP25hWW+ODndnIWdmCT1eXd3NAMmM6OoYfxZMeJn6hOy6swxNwNx6kXnV7cEi0cPXgwNin36OZWtTjwku95rkPvx0iEzlcVfJRZP60Jxe266qWc7eg+JLNjI3RLvqes19ZOxcnWkFAJRJ+GnDtCeM6CXyi4Ytwmeh/aFQwdkuKW1Y1LuJFmZAisGTnrMSS05d5VwSYqxEZj3brh+iiKpnn6v7P26uP765tpe7AtegD+mVmAc8FJGDY0F4hi6CuewsmviyMcxhmrv/4aVJ5pSxnIjt4BJCeux3qu932RL6BJCrJqE12YUYzfc3sIaBQvWNLii5tDgml5O/WNBg1nlzNSHlxzJDBBt+9aoFxBGXUx6lpg+e/6hrrWn4sDAPYVDBHttKX48R+nXTWO" \ No newline at end of file +window.navigationData = "eJyll8tu2zAQRf+Fa6dJ3CZtvQvcBww4jWEnyKLogqXGEhGJZEkqtVv03wtJlvXgQwK1jOfyHEoiB5Pvf5GGg0YLtAUlOFPweBSAZkhgnaAFApZn6rJde5PoLEUz9EJZhBYfZoikWCm0QFpFF1RdwEGDZDhF/2Zn9l2uE2CaEqwpZ5+l5LJRlOtBXVpCXdf1fJxtyRkDoh2adjWM/xUYSEoc/HY1jL9i95BxeVxikoAp6JTDDGtOcLrTXOIYHBYjEma63+Mt/MqphMjxvvqJQA9VirJ4C3sJKnnkL+A6Zq5kmPehOLUOU1Mz2C3ChotcLDEjkKbOl2QJhe23BD3SDHjuuiBGJMzkl0znPyn4JLj4xhkBh8SIBJvs8EBecSyulpwVf66YBrnHpHUDaf1T1RKNZFc6v7ntozeSv9II5IMoGqlyk3vBITCX9E/ZmzdY4szN7eUM7Mgmq8u7uaMpMJ0efQ/jyE4TP1OdlFdhjLkfDlOver24JVpZevBobFTu0c6tamHgNY95rn3vp5Pwna8q+CTTYVoTCtt11Us529PYJzNjE3RrHlM2aGunwmRbiKgEok9Dzh0hPGfeL+RdMW0Tgw9tC/oOSXHL6sYl7MhuZAysGTnrMcS35cFV3iYqxE5j3brh+iiKpnn6vbf26uP765t5e7AtegD+mRqAc8FKGDc0F4hi6CuewsqvixMcnTNWf/0tqDzVhtKTnbwDiE5ch/VcH/wiudI8q4bIA0kwi8E4PSeyMxn+NF9AkwRk1aT6wk4x3FHtmEWC0+IzVP8H9l3WULizPfY0qlcsaXHGu2NR1/J27hqGGs4+Z6R88d0hqAu6fdcC5QrKqI1R1zzLf9c9ybb+XBwBMJuOj2imDcWP//QYiiQ=" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index 37c2f273..34f2f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EiY0M4LEU9iECZMwoZkR9CZsEyZMwoRmRkhyzDZhwiRMaGYEiaewCRMmYUIzIzZkzzZhwiRMaGYEiaewCRMmYXI1OmZpEyZNwiQftS1twqRJmNTMCDIxpE2YNAmTFWFkYkibMDk4blXnLTIxJHHiMgmTmhlJsi1twqRJmNTMSJJtaRPW/FQdrh9UXqrwfX3IPh6Zn2VF/b/vI/vanL3Fuj3rPzKxZYfHp6f+rH14fELHbf1M99W8Res1YI80Vu4a3ZsoZGfXS0mYLdW9bMCaEkm6K2bdf3jIHRqoFPO1urdaaO54LwluA+6/AyAZQDJuzqZupPTCCI/1HFn0qgPN3waBsqsFJHeV7W9G9Ypo9px1hsyBQHMn6zjhuBTmzZleEw1046TUXH5BrpCpOsYtO4lLVmgB0Py7qZmXX3qlba+0c1Ii7qz0aijr945q9C2TXhKlKnerSaP3QhBuK6TqBpx5qwNJYXTdaLPvYyA5xAt3W9uxOxRIFPHC3Wqndf0BqaFCzN2KCbqvgHRQTeJu2WV+U0D5gBZBuM3a8JoC8oWSnrslK3G/AOmhHONuSdbeEUAiKLW4W27VItRehQYIbgNMKxqGtQ1lkVtqjn1kQSuJ+BduqFJfkNFgEa3gRuvg0woyh+uum1arNEYuIDjADY7BFwFkD2kJN0b6V/5IBs2Y2DS7u9v6FmNFElVxcJQiP7+jiUPVA9yqx7lQ1plXIoalG2/1pRXkBEmA22aiS4VtBRUx6UZXp5PV3+ORKVQvwI2FVqxPzLz7RoBcogSVbvM+LkyVcjSbwmE2rz2WRZmKo0Sxw/H66el/H0H8AQ=="; \ No newline at end of file diff --git a/docs/classes/AuthenticationError.html b/docs/classes/AuthenticationError.html index 1aeffaa9..b7fc8047 100644 --- a/docs/classes/AuthenticationError.html +++ b/docs/classes/AuthenticationError.html @@ -1,6 +1,6 @@
Thrown when handling the redirect callback for the connect flow fails, will be one of Auth0's Authentication API's Standard Error Responses: https://auth0.com/docs/api/authentication?javascript#standard-error-responses
-Thrown when network requests to the Auth server fail.
-Error thrown when the token exchange results in a mfa_required error
Error thrown when there is no refresh token to use
-An OAuth2 error will come from the authorization server and will have at least an error property which will
be the error code. And possibly an error_description property
See: https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.3.1.2.6
-Optionalerror_description: stringOptionalerror_description: stringOptionalerror_OptionalstackStatic OptionalprepareOptional override for formatting stack traces
StaticstackThrown when network requests to the Auth server fail.
-Error thrown when the login popup times out (if the user does not complete auth)
-Thrown when silent auth times out (usually due to a configuration issue) or when network requests to the Auth server timeout.
-Error thrown when the wrong DPoP nonce is used and a potential subsequent retry wasn't able to fix it.
-Provides the Auth0Context to its child components.
-const {
// Auth state:
error,
isAuthenticated,
isLoading,
user,
// Auth methods:
getAccessTokenSilently,
getAccessTokenWithPopup,
getIdTokenClaims,
loginWithRedirect,
loginWithPopup,
logout,
} = useAuth0<TUser>();
+useAuth0 | @auth0/auth0-react Function useAuth0
- useAuth0<TUser extends User = User>(
context?: Context<Auth0ContextInterface<User>>,
): Auth0ContextInterface<TUser>const {
// Auth state:
error,
isAuthenticated,
isLoading,
user,
// Auth methods:
getAccessTokenSilently,
getAccessTokenWithPopup,
getIdTokenClaims,
exchangeToken,
loginWithRedirect,
loginWithPopup,
logout,
} = useAuth0<TUser>();
Use the useAuth0 hook in your components to access the auth state and methods.
TUser is an optional type param to provide a type to the user field.
-Type Parameters
Parameters
- context: Context<Auth0ContextInterface<User>> = Auth0Context
Returns Auth0ContextInterface<TUser>
+Wrap your class components in this Higher Order Component to give them access to the Auth0Context.
Providing a context as the second argument allows you to configure the Auth0Provider the Auth0Context should come from f you have multiple within your application.
-When you wrap your components in this Higher Order Component and an anonymous user visits your component they will be redirected to the login page; after login they will be returned to the page they were redirected from.
-Contains the authenticated state and authentication methods provided by the useAuth0 hook.
If connecting the account is successful onRedirectCallback will be called
with the details of the connected account.
Returns a new Fetcher class that will contain a fetchWithAuth() method.
+
Returns a new Fetcher class that will contain a fetchWithAuth() method.
This is a drop-in replacement for the Fetch API's fetch() method, but will
handle certain authentication logic for you, like building the proper auth
headers or managing DPoP nonces and retries automatically.
Check the EXAMPLES.md file for a deeper look into this method.
Optionalconfig: FetcherConfig<TOutput>Returns a string to be used to demonstrate possession of the private +
Optionalconfig: FetcherConfig<TOutput>const tokenResponse = await exchangeToken({
subject_token: 'external_token_value',
subject_token_type: 'urn:acme:legacy-system-token',
scope: 'openid profile email'
});
+
+
+Exchanges an external subject token for Auth0 tokens via a token exchange request.
+This method implements the token exchange grant as specified in RFC 8693.
+It performs a token exchange by sending a request to the /oauth/token endpoint
+with the external token and returns Auth0 tokens (access token, ID token, etc.).
The request includes the following parameters:
+grant_type: Hard-coded to "urn:ietf:params:oauth:grant-type:token-exchange"subject_token: The external token to be exchangedsubject_token_type: A namespaced URI identifying the token type (must be under your organization's control)audience: The target audience (falls back to the SDK's default audience if not provided)scope: Space-separated list of scopes (merged with the SDK's default scopes)The options required to perform the token exchange
+A promise that resolves to the token endpoint response containing Auth0 tokens
+Returns a string to be used to demonstrate possession of the private key used to cryptographically bind access tokens with DPoP.
It requires enabling the Auth0ClientOptions.useDpop option.
Returns a string to be used to demonstrate possession of the private key used to cryptographically bind access tokens with DPoP.
It requires enabling the Auth0ClientOptions.useDpop option.
-const token = await getAccessTokenSilently(options);
+const token = await getAccessTokenSilently(options);
If there's a valid token stored, return it. Otherwise, opens an @@ -58,7 +76,7 @@ back to using an iframe to make the token exchange.
Note that in all cases, falling back to an iframe requires access to
the auth0 cookie.
const token = await getTokenWithPopup(options, config);
+const token = await getTokenWithPopup(options, config);
Get an access token interactively.
@@ -66,7 +84,7 @@ provided as arguments. Random and securestate and nonce
parameters will be auto-generated. If the response is successful,
results will be valid according to their expiration times.
-Returns the current DPoP nonce used for making requests to Auth0.
+Returns the current DPoP nonce used for making requests to Auth0.
It can return undefined because when starting fresh it will not
be populated until after the first response from the server.
It requires enabling the Auth0ClientOptions.useDpop option.
@@ -81,16 +99,16 @@const claims = await getIdTokenClaims();
+const claims = await getIdTokenClaims();
Returns all claims from the id_token if available.
-After the browser redirects back to the callback page, +
After the browser redirects back to the callback page,
call handleRedirectCallback to handle success and error
responses from Auth0. If the response is successful, results
will be valid according to their expiration times.
Optionalurl: stringThe URL to that should be used to retrieve the state and code values. Defaults to window.location.href if not given.
await loginWithPopup(options, config);
+await loginWithPopup(options, config);
Opens a popup with the /authorize URL using the parameters
@@ -100,20 +118,20 @@
IMPORTANT: This method has to be called from an event handler that was started by the user like a button click, for example, otherwise the popup will be blocked in most browsers.
-await loginWithRedirect(options);
+await loginWithRedirect(options);
Performs a redirect to /authorize using the parameters
provided as arguments. Random and secure state and nonce
parameters will be auto-generated.
auth0.logout({ logoutParams: { returnTo: window.location.origin } });
+auth0.logout({ logoutParams: { returnTo: window.location.origin } });
Clears the application session and performs a redirect to /v2/logout, using
the parameters provided as arguments, to clear the Auth0 session.
If the logoutParams.federated option is specified, it also clears the Identity Provider session.
Read more about how Logout works at Auth0.
Sets the current DPoP nonce used for making requests to Auth0.
+Sets the current DPoP nonce used for making requests to Auth0.
It requires enabling the Auth0ClientOptions.useDpop option.
Sets the current DPoP nonce used for making requests to Auth0.
It requires enabling the Auth0ClientOptions.useDpop option.
@@ -125,4 +143,4 @@The main configuration to instantiate the Auth0Provider.
memory.
Read more about changing storage options in the Auth0 docs
OptionalchildrenThe child nodes your Provider has wrapped
-The Client ID found on your Application settings page
+The Client ID found on your Application settings page
OptionalcontextContext to be used when creating the Auth0Provider, defaults to the internally created context.
This allows multiple Auth0Providers to be nested within the same application, the context value can then be passed to useAuth0, withAuth0, or withAuthenticationRequired to use that specific Auth0Provider to access @@ -48,7 +48,7 @@ used to store data is different
For a sample on using multiple Auth0Providers review the React Account Linking Sample
-OptionalcookieThe domain the cookie is accessible from. If not set, the cookie is scoped to +
OptionalcookieThe domain the cookie is accessible from. If not set, the cookie is scoped to the current domain, including the subdomain.
Note: setting this incorrectly may cause silent authentication to stop working on page load.
@@ -73,7 +73,7 @@OptionalonBy default this removes the code and state parameters from the url when you are redirected from the authorize page.
It uses window.history but you might want to overwrite this if you are using a custom router, like react-router-dom
See the EXAMPLES.md for more info.
OptionalsessionNumber of days until the cookie auth0.is.authenticated will expire
+
OptionalsessionNumber of days until the cookie auth0.is.authenticated will expire
Defaults to 1.
OptionalskipBy default, if the page url has code/state params, the SDK will treat them as Auth0's and attempt to exchange the code for a token. In some cases the code might be for something else (another OAuth SDK perhaps). In these @@ -81,7 +81,7 @@
<Auth0Provider
clientId={clientId}
domain={domain}
skipRedirectCallback={window.location.pathname === '/stripe-oauth-callback'}
>
-OptionaluseIf true, the SDK will use a cookie when storing information about the auth transaction while
+
OptionaluseIf true, the SDK will use a cookie when storing information about the auth transaction while
the user is going through the authentication flow on the authorization server.
The default is false, in which case the SDK will use session storage.
You might want to enable this if you rely on your users being able to authenticate using flows that diff --git a/docs/interfaces/GetTokenWithPopupOptions.html b/docs/interfaces/GetTokenWithPopupOptions.html index 819e1f39..47a39a89 100644 --- a/docs/interfaces/GetTokenWithPopupOptions.html +++ b/docs/interfaces/GetTokenWithPopupOptions.html @@ -1,4 +1,4 @@ -
OptionalauthorizationURL parameters that will be sent back to the Authorization Server. This can be known parameters defined by Auth0 or custom parameters that you define.
diff --git a/docs/interfaces/LogoutOptions.html b/docs/interfaces/LogoutOptions.html index 707ef5c6..c4c48fcf 100644 --- a/docs/interfaces/LogoutOptions.html +++ b/docs/interfaces/LogoutOptions.html @@ -1,4 +1,4 @@ -OptionalclientThe clientId of your application.
Components wrapped in withAuth0 will have an additional auth0 prop
Options for the withAuthenticationRequired Higher Order Component
-OptionalcontextThe context to be used when calling useAuth0, this should only be provided if you are using multiple Auth0Providers within your application and you wish to tie a specific component to a Auth0Provider other than the Auth0Provider associated with the default Auth0Context.
-OptionalloginwithAuthenticationRequired(Profile, {
loginOptions: {
appState: {
customProp: 'foo'
}
}
})
+OptionalloginwithAuthenticationRequired(Profile, {
loginOptions: {
appState: {
customProp: 'foo'
}
}
})
Pass additional login options, like extra appState to the login page.
This will be merged with the returnTo option used by the onRedirectCallback handler.
OptionalonwithAuthenticationRequired(Profile, {
onBeforeAuthentication: () => { analyticsLibrary.track('login_triggered'); }
})
+OptionalonwithAuthenticationRequired(Profile, {
onBeforeAuthentication: () => { analyticsLibrary.track('login_triggered'); }
})
Allows executing logic before the user is redirected to the login page.
-OptionalonwithAuthenticationRequired(Profile, {
onRedirecting: () => <div>Redirecting you to the login...</div>
})
+OptionalonwithAuthenticationRequired(Profile, {
onRedirecting: () => <div>Redirecting you to the login...</div>
})
Render a message to show that the user is being redirected to the login.
-OptionalreturnwithAuthenticationRequired(Profile, {
returnTo: '/profile'
})
+OptionalreturnwithAuthenticationRequired(Profile, {
returnTo: '/profile'
})
or
@@ -28,4 +28,4 @@Add a path for the onRedirectCallback handler to return the user to after login.
The state of the application before the user was redirected to the login page and any account that the user may have connected to.
-The account that has been connected during the connect flow.
-Represents the configuration options required for initiating a Custom Token Exchange request +following RFC 8693 specifications.
+Additional custom parameters for Auth0 Action processing
+OptionalaudienceThe target audience for the requested Auth0 token
+OptionalscopeSpace-separated list of OAuth 2.0 scopes being requested
+The opaque token value being exchanged for Auth0 tokens
+The type identifier for the subject token being exchanged
+ConstThe Auth0 Context
-
Thrown when handling the redirect callback fails, will be one of Auth0's Authentication API's Standard Error Responses: https://auth0.com/docs/api/authentication?javascript#standard-error-responses
-