diff --git a/auth0_flutter/lib/auth0_flutter_web.dart b/auth0_flutter/lib/auth0_flutter_web.dart index d12e14c6..73a5f5c5 100644 --- a/auth0_flutter/lib/auth0_flutter_web.dart +++ b/auth0_flutter/lib/auth0_flutter_web.dart @@ -278,15 +278,15 @@ class Auth0Web { /// RFC 8693 Token Exchange. /// /// This method implements the OAuth 2.0 Token Exchange flow, allowing you to - /// exchange a token from an external provider for Auth0 tokens. This is useful - /// when integrating with external identity providers or custom authentication - /// systems. + /// exchange a token from an external provider for Auth0 tokens. + /// This is useful when integrating with external identity providers or + /// custom authentication systems. /// /// **Parameters:** /// /// * [subjectToken] (required) - The token being exchanged from the external - /// provider. For example, this might be a JWT from your custom authentication - /// system or another identity provider. + /// provider. For example, this might be a JWT from your + /// custom authentication system or another identity provider. /// /// * [subjectTokenType] (required) - A URI identifying the type of the /// subject token according to RFC 8693. Must be a namespaced URI under your @@ -301,7 +301,8 @@ class Auth0Web { /// /// * [audience] - Optional API identifier for which you want to receive an /// access token. Must match exactly with an API identifier configured in - /// your Auth0 tenant. If not provided, falls back to the client's default audience. + /// your Auth0 tenant. If not provided, falls back to the client's default + /// audience. /// /// * [scopes] - Optional set of scopes to request. /// These scopes determine what permissions the resulting tokens will have. @@ -316,13 +317,15 @@ class Auth0Web { /// * `idToken` - The Auth0 ID token with user information /// * `expiresAt` - When the access token expires /// * `scopes` - The granted scopes - /// * `refreshToken` - Optional refresh token (if offline_access scope was requested) + /// * `refreshToken` - Optional refresh token /// /// **Requirements:** /// /// 1. Configure a Token Exchange profile in your Auth0 Dashboard - /// 2. Implement validation logic in an Auth0 Action to verify the external token - /// 3. Grant your Auth0 application the `urn:auth0:oauth2:grant-type:token-exchange` permission + /// 2. Implement validation logic in an Auth0 Action to verify the external + /// token + /// 3. Grant your Auth0 application the + /// `urn:auth0:oauth2:grant-type:token-exchange` permission /// /// **Example:** /// diff --git a/auth0_flutter/lib/src/mobile/authentication_api.dart b/auth0_flutter/lib/src/mobile/authentication_api.dart index 15599d08..5dd57604 100644 --- a/auth0_flutter/lib/src/mobile/authentication_api.dart +++ b/auth0_flutter/lib/src/mobile/authentication_api.dart @@ -349,20 +349,20 @@ class AuthenticationApi { scopes: scopes, parameters: parameters))); - /// Performs a custom token exchange to obtain Auth0 credentials using an + /// Performs a custom token exchange to obtain Auth0 credentials using an /// existing identity provider token. /// /// This method allows you to exchange tokens from external identity providers - /// for Auth0 tokens, enabling seamless integration with existing authentication - /// systems. + /// for Auth0 tokens, enabling seamless integration with existing + /// authentication systems. /// /// ## Endpoint /// https://auth0.com/docs/api/authentication#token-exchange /// /// ## Notes /// - /// * [subjectToken] is the token obtained from the external identity provider. - /// * [subjectTokenType] specifies the format of the subject token (e.g., + /// * [subjectToken] the token obtained from the external identity provider. + /// * [subjectTokenType] specifies the format of the subject token (e.g., /// 'http://acme.com/legacy-token'). /// * [audience] relates to the API Identifier you want to reference in your /// access tokens. See [API settings](https://auth0.com/docs/get-started/apis/api-settings) diff --git a/auth0_flutter/test/mobile/web_authentication_test.dart b/auth0_flutter/test/mobile/web_authentication_test.dart index c15db2f5..e1fb6210 100644 --- a/auth0_flutter/test/mobile/web_authentication_test.dart +++ b/auth0_flutter/test/mobile/web_authentication_test.dart @@ -329,7 +329,8 @@ void main() { expect(verificationResult.options.useHTTPS, true); expect(verificationResult.options.returnTo, 'https://example.com/logout'); expect(verificationResult.options.federated, true); - expect(verificationResult.options.allowedBrowsers, ['com.android.chrome']); + expect(verificationResult.options.allowedBrowsers, + ['com.android.chrome']); }); }); diff --git a/auth0_flutter/test/web/auth0_flutter_web_test.dart b/auth0_flutter/test/web/auth0_flutter_web_test.dart index 477da108..a3ba905c 100644 --- a/auth0_flutter/test/web/auth0_flutter_web_test.dart +++ b/auth0_flutter/test/web/auth0_flutter_web_test.dart @@ -497,7 +497,8 @@ void main() { for (final errorCase in errorCases) { when(mockClientProxy.exchangeToken(any)) - .thenThrow(createJsException(errorCase['code']!, errorCase['message']!)); + .thenThrow(createJsException(errorCase['code']!, + errorCase['message']!)); await expectLater( auth0.customTokenExchange( diff --git a/auth0_flutter_platform_interface/lib/src/auth0_flutter_web_platform.dart b/auth0_flutter_platform_interface/lib/src/auth0_flutter_web_platform.dart index f2a4d2e4..ad13215f 100644 --- a/auth0_flutter_platform_interface/lib/src/auth0_flutter_web_platform.dart +++ b/auth0_flutter_platform_interface/lib/src/auth0_flutter_web_platform.dart @@ -41,7 +41,9 @@ abstract class Auth0FlutterWebPlatform extends PlatformInterface { } Future customTokenExchange(final ExchangeTokenOptions options) { - throw UnimplementedError('web.customTokenExchange has not been implemented'); + throw UnimplementedError( + 'web.customTokenExchange has not been implemented' + ); } Future hasValidCredentials() { diff --git a/auth0_flutter_platform_interface/lib/src/web/exchange_token_options.dart b/auth0_flutter_platform_interface/lib/src/web/exchange_token_options.dart index c4190662..8fda1557 100644 --- a/auth0_flutter_platform_interface/lib/src/web/exchange_token_options.dart +++ b/auth0_flutter_platform_interface/lib/src/web/exchange_token_options.dart @@ -7,9 +7,11 @@ /// /// * [subjectToken] - The external token to be exchanged (required) /// * [subjectTokenType] - A URI that indicates the type of the subject token, -/// * [audience] - The API identifier for which the access token is requested (optional) +/// * [audience] - The API identifier for which the access token is +/// requested (optional) /// * [scopes] - Set of OAuth scopes to request (optional) -/// * [organizationId] - organization ID or name of the organization to authenticate with (optional) +/// * [organizationId] - organization ID or name of the organization to +/// authenticate with (optional) class ExchangeTokenOptions { final String subjectToken; final String subjectTokenType;