From 05b1661fc94eb9a01472c8eea1e027f18c3d8f0d Mon Sep 17 00:00:00 2001 From: Dat PHAM HOANG Date: Tue, 7 Nov 2023 18:40:38 +0100 Subject: [PATCH] Support oidcTokenType from configuration --- .../authentication_oidc_datasource.dart | 1 + .../authentication_datasource_impl.dart | 4 - .../authentication_oidc_datasource_impl.dart | 3 +- .../authentication_token_extension.dart | 6 +- .../lib/src/local/model/token_oidc_cache.dart | 7 +- .../lib/src/network/linshare_http_client.dart | 12 +- .../authentication_oidc_repository_impl.dart | 2 + data/lib/src/util/constant.dart | 4 + data/lib/src/util/oidc_parser.dart | 8 + data/test/oidc_parser_test.dart | 2 + domain/lib/domain.dart | 205 +++++++++--------- .../authentication/oidc_configuration.dart | 4 +- .../src/model/authentication/token_oidc.dart | 5 +- domain/lib/src/model/constant.dart | 38 ++++ .../authentication_oidc_repository.dart | 1 + .../get_token_oidc_interactor.dart | 2 + domain/test/fixture/test_fixture.dart | 5 +- .../widget/login/login_viewmodel.dart | 4 +- .../widget/sign_up/sign_up_viewmodel.dart | 4 +- 19 files changed, 190 insertions(+), 127 deletions(-) create mode 100644 domain/lib/src/model/constant.dart diff --git a/data/lib/src/datasource/authentication_oidc_datasource.dart b/data/lib/src/datasource/authentication_oidc_datasource.dart index fc429a7b7..01faed423 100644 --- a/data/lib/src/datasource/authentication_oidc_datasource.dart +++ b/data/lib/src/datasource/authentication_oidc_datasource.dart @@ -37,6 +37,7 @@ abstract class AuthenticationOIDCDataSource { String clientId, String redirectUrl, String discoveryUrl, + String oidcTokenType, List scopes, bool preferEphemeralSessionIOS, List? promptValues, diff --git a/data/lib/src/datasource_impl/authentication_datasource_impl.dart b/data/lib/src/datasource_impl/authentication_datasource_impl.dart index 607954efa..bf998ac2b 100644 --- a/data/lib/src/datasource_impl/authentication_datasource_impl.dart +++ b/data/lib/src/datasource_impl/authentication_datasource_impl.dart @@ -32,11 +32,7 @@ import 'dart:developer' as developer; import 'package:data/data.dart'; -import 'package:data/src/network/model/request/permanent_token_body_request.dart'; -import 'package:data/src/network/model/response/permanent_token.dart'; import 'package:data/src/network/model/response/user_response.dart'; -import 'package:data/src/util/constant.dart'; -import 'package:data/src/util/device_manager.dart'; import 'package:dio/dio.dart'; import 'package:domain/domain.dart'; diff --git a/data/lib/src/datasource_impl/authentication_oidc_datasource_impl.dart b/data/lib/src/datasource_impl/authentication_oidc_datasource_impl.dart index 4a225f3f5..2cd20249e 100644 --- a/data/lib/src/datasource_impl/authentication_oidc_datasource_impl.dart +++ b/data/lib/src/datasource_impl/authentication_oidc_datasource_impl.dart @@ -64,6 +64,7 @@ class AuthenticationOIDCDataSourceImpl implements AuthenticationOIDCDataSource { String clientId, String redirectUrl, String discoveryUrl, + String oidcTokenType, List scopes, bool preferEphemeralSessionIOS, List? promptValues, @@ -81,7 +82,7 @@ class AuthenticationOIDCDataSourceImpl implements AuthenticationOIDCDataSource { developer.log('getTokenOIDC(): ${result?.idToken.toString()}', name: 'AuthenticationOIDCDataSourceImpl'); if(result != null) { - final tokenOIDC = result.toTokenOIDC(); + final tokenOIDC = result.toTokenOIDC(oidcTokenType); if (tokenOIDC.isTokenValid()) { return tokenOIDC; } else { diff --git a/data/lib/src/extensions/authentication_token_extension.dart b/data/lib/src/extensions/authentication_token_extension.dart index 999efc35f..317083928 100644 --- a/data/lib/src/extensions/authentication_token_extension.dart +++ b/data/lib/src/extensions/authentication_token_extension.dart @@ -34,11 +34,13 @@ import 'package:flutter_appauth/flutter_appauth.dart'; extension AuthorizationTokenResponseExtension on AuthorizationTokenResponse { - TokenOIDC toTokenOIDC() { + TokenOIDC toTokenOIDC(String? oidcTokenType) { return TokenOIDC( accessToken ?? '', TokenId(idToken ?? ''), accessTokenExpirationDateTime ?? DateTime.now(), - refreshToken ?? ''); + refreshToken ?? '', + oidcTokenType ?? DomainConstant.opaqueOidc, + ); } } \ No newline at end of file diff --git a/data/lib/src/local/model/token_oidc_cache.dart b/data/lib/src/local/model/token_oidc_cache.dart index 8176aebc3..7149ec2ef 100644 --- a/data/lib/src/local/model/token_oidc_cache.dart +++ b/data/lib/src/local/model/token_oidc_cache.dart @@ -46,14 +46,15 @@ class TokenOIDCCache with EquatableMixin { final TokenId tokenId; final DateTime expiredTime; final String refreshToken; + final String oidcTokenType; - TokenOIDCCache(this.token, this.tokenId, this.expiredTime, this.refreshToken); + TokenOIDCCache(this.token, this.tokenId, this.expiredTime, this.refreshToken, this.oidcTokenType); factory TokenOIDCCache.fromJson(Map json) => _$TokenOIDCCacheFromJson(json); Map toJson() => _$TokenOIDCCacheToJson(this); - TokenOIDC toTokenOIDC() => TokenOIDC(token, tokenId, expiredTime, refreshToken); + TokenOIDC toTokenOIDC() => TokenOIDC(token, tokenId, expiredTime, refreshToken, this.oidcTokenType); @override List get props => [token, tokenId, expiredTime, refreshToken]; @@ -61,6 +62,6 @@ class TokenOIDCCache with EquatableMixin { extension TokenOIDCExtension on TokenOIDC { TokenOIDCCache toTokenOIDCCache() { - return TokenOIDCCache(token, tokenId, expiredTime, refreshToken); + return TokenOIDCCache(token, tokenId, expiredTime, refreshToken, oidcTokenType); } } diff --git a/data/lib/src/network/linshare_http_client.dart b/data/lib/src/network/linshare_http_client.dart index c070ee940..437ec1d86 100644 --- a/data/lib/src/network/linshare_http_client.dart +++ b/data/lib/src/network/linshare_http_client.dart @@ -118,18 +118,20 @@ class LinShareHttpClient { final bearerAuth = 'Bearer ${oidcToken.token}'; final resultJson = await _dioClient.post( Endpoint.authentication.generateAuthenticationUrl(authenticateUrl, apiVersion), - options: Options(headers: _buildPermanentTokenRequestParam(bearerAuth, otpCode: otpCode, tokenId: oidcToken.tokenId.uuid)), + options: Options(headers: _buildPermanentTokenRequestParam(bearerAuth, otpCode: otpCode, tokenOidcType: oidcToken.oidcTokenType, tokenId: oidcToken.tokenId.uuid)), data: bodyRequest.toJson()); return PermanentToken.fromJson(resultJson); } - Map _buildPermanentTokenRequestParam(String authorizationHeader, {OTPCode? otpCode, String? tokenId}) { + Map _buildPermanentTokenRequestParam(String authorizationHeader, {OTPCode? otpCode, String? tokenOidcType,String? tokenId}) { final headerParam = _dioClient.getHeaders(); headerParam[HttpHeaders.authorizationHeader] = authorizationHeader; - headerParam['X-LinShare-Auth-Provider'] = 'Oidc-Jwt'; - headerParam['X-LinShare-Client-App'] = 'Linshare-Web'; + if (tokenOidcType != null) { + headerParam[Constant.linshareAuthProviderHeader] = tokenOidcType; + } + headerParam[Constant.linshareClientAppHeader] = Constant.linshareClientAppValue; if (tokenId != null) { - headerParam['X-Linshare-Id-Token'] = tokenId; + headerParam[Constant.linshareTokenIdHeader] = tokenId; } if (otpCode != null && otpCode.value.isNotEmpty) { headerParam[Constant.linShare2FAPin] = otpCode.value; diff --git a/data/lib/src/repository/authentication/authentication_oidc_repository_impl.dart b/data/lib/src/repository/authentication/authentication_oidc_repository_impl.dart index 939cae21d..5f3c6e202 100644 --- a/data/lib/src/repository/authentication/authentication_oidc_repository_impl.dart +++ b/data/lib/src/repository/authentication/authentication_oidc_repository_impl.dart @@ -45,6 +45,7 @@ class AuthenticationOIDCRepositoryImpl extends AuthenticationOIDCRepository { String clientId, String redirectUrl, String discoveryUrl, + String oidcTokenType, List scopes, bool preferEphemeralSessionIOS, List? promptValues, @@ -53,6 +54,7 @@ class AuthenticationOIDCRepositoryImpl extends AuthenticationOIDCRepository { clientId, redirectUrl, discoveryUrl, + oidcTokenType, scopes, preferEphemeralSessionIOS, promptValues, diff --git a/data/lib/src/util/constant.dart b/data/lib/src/util/constant.dart index 14bc7dcac..7e13c7964 100644 --- a/data/lib/src/util/constant.dart +++ b/data/lib/src/util/constant.dart @@ -39,4 +39,8 @@ class Constant { static const biometricSettingState = 'biometric_setting_state'; static const biometricSettingTimeoutMilliseconds = 'biometric_setting_timeout_milliseconds'; static const defaultBiometricAuthenticationTimeoutInMilliseconds = 3 * 60 * 1000; + static const linshareAuthProviderHeader = 'X-LinShare-Auth-Provider'; + static const linshareClientAppHeader = 'X-LinShare-Client-App'; + static const linshareClientAppValue = 'Linshare-Web'; + static const linshareTokenIdHeader = 'X-Linshare-Id-Token'; } diff --git a/data/lib/src/util/oidc_parser.dart b/data/lib/src/util/oidc_parser.dart index 7c8077839..5f0ebf582 100644 --- a/data/lib/src/util/oidc_parser.dart +++ b/data/lib/src/util/oidc_parser.dart @@ -8,6 +8,7 @@ class OIDCParser { final matchString = regExp.stringMatch(oidcString) ?? ''; if (matchString.isNotEmpty) { + final regexOidcType = RegExp('(oidcToken:)(.\')(.\*)(\')'); final regExpAuthority = RegExp('(authority:)(.\')(.\*)(\')'); final regExpClientId = RegExp('(client_id:)(.\')(.\*)(\')'); final regExpRedirectUrl = RegExp('(redirect_url:)(.\')(.\*)(\')'); @@ -15,6 +16,7 @@ class OIDCParser { final regExpResponseType = RegExp('(response_type:)(.\')(.\*)(\')'); final regExpScope = RegExp('(scope:)(.\')(.\*)(\')'); + final oidcTypeMatch = regexOidcType.allMatches(matchString).first.group(3) ?? ''; final authorityMatch = regExpAuthority.allMatches(matchString).first.group(3) ?? ''; final clientIdMatch = regExpClientId.allMatches(matchString).first.group(3) ?? ''; final _ = regExpRedirectUrl.allMatches(matchString).first.group(3) ?? ''; @@ -22,11 +24,17 @@ class OIDCParser { final scopeMatch = regExpScope.allMatches(matchString).first.group(3) ?? ''; final responseTypeMatch = regExpResponseType.allMatches(matchString).first.group(3) ?? ''; + String oidcTokenType = DomainConstant.opaqueOidc; + if (oidcTypeMatch == 'JWT') { + oidcTokenType = DomainConstant.jwtOidc; + } + return OIDCConfiguration( authority: authorityMatch, clientId: clientIdMatch, logoutRedirectUri: logoutUrlMatch, responseType: responseTypeMatch, + oidcTokenType: oidcTokenType, scopes: scopeMatch.split(' '), ); } diff --git a/data/test/oidc_parser_test.dart b/data/test/oidc_parser_test.dart index d604cfc54..9bd8243c1 100644 --- a/data/test/oidc_parser_test.dart +++ b/data/test/oidc_parser_test.dart @@ -43,6 +43,7 @@ void main() { clientId: 'linshare-mobile', responseType: 'code', logoutRedirectUri: 'linshare.mobile://oauthredirect', + oidcTokenType: 'Oidc-Jwt', scopes: ['openid', 'email', 'profile'], ); @@ -90,6 +91,7 @@ void main() { mobileOidcEnabled: false, mobileOidcSetting: { + oidcToken: 'JWT', authority: 'https://auth.linshare.local/', client_id: 'linshare-mobile', redirect_url: 'linshare.mobile://oauthredirect', diff --git a/domain/lib/domain.dart b/domain/lib/domain.dart index 116ec0447..5f77d8504 100644 --- a/domain/lib/domain.dart +++ b/domain/lib/domain.dart @@ -6,16 +6,20 @@ export 'src/extension/audit_log_entry_type.dart'; export 'src/extension/biometric_authentication_timeout_extension.dart'; export 'src/extension/biometric_authentication_timeout_extension.dart'; export 'src/extension/biometric_authentication_timeout_extension.dart'; +export 'src/extension/biometric_authentication_timeout_extension.dart'; +export 'src/extension/biometric_authentication_timeout_extension.dart'; export 'src/extension/boolean_sort_extension.dart'; export 'src/extension/date_time_extension.dart'; export 'src/extension/document_extensions.dart'; - // extension export 'src/extension/email_validator_string_extension.dart'; export 'src/extension/integer_extension.dart'; export 'src/extension/list_document_extension.dart'; export 'src/extension/list_received_share_extension.dart'; export 'src/extension/list_received_share_extension.dart'; +export 'src/extension/list_upload_request_entry_extension.dart'; +export 'src/extension/list_upload_request_extension.dart'; +export 'src/extension/list_upload_request_group_extension.dart'; export 'src/extension/list_validator_extension.dart'; export 'src/extension/list_validator_extension.dart'; export 'src/extension/list_work_group_extension.dart'; @@ -23,32 +27,30 @@ export 'src/extension/list_work_group_node_extension.dart'; export 'src/extension/media_type_extension.dart'; export 'src/extension/name_validator_string_extension.dart'; export 'src/extension/order_by_extension.dart'; -export 'src/extension/upload_request_status_extension.dart'; -export 'src/extension/biometric_authentication_timeout_extension.dart'; export 'src/extension/received_share_extensions.dart'; export 'src/extension/shared_space_node_nested_extensions.dart'; export 'src/extension/shared_space_node_nested_extensions.dart'; export 'src/extension/shared_space_node_nested_extensions.dart'; +export 'src/extension/shared_space_node_nested_extensions.dart'; export 'src/extension/string_extension.dart'; export 'src/extension/upload_request_status_extension.dart'; -export 'src/extension/work_group_document_extensions.dart'; -export 'src/extension/list_upload_request_group_extension.dart'; -export 'src/extension/list_upload_request_extension.dart'; export 'src/extension/upload_request_status_extension.dart'; -export 'src/extension/biometric_authentication_timeout_extension.dart'; -export 'src/extension/shared_space_node_nested_extensions.dart'; +export 'src/extension/upload_request_status_extension.dart'; +export 'src/extension/work_group_document_extensions.dart'; export 'src/extension/work_group_document_extensions.dart'; export 'src/extension/work_group_node_extensions.dart'; -export 'src/extension/list_upload_request_entry_extension.dart'; - -// model -export 'src/model/api_version_supported.dart'; export 'src/model/account/account.dart'; export 'src/model/account/account_id.dart'; export 'src/model/account/account_type.dart'; export 'src/model/account/last_login.dart'; export 'src/model/account/last_login.dart'; +export 'src/model/account/last_login.dart'; +// model +export 'src/model/api_version_supported.dart'; +export 'src/model/app_mode.dart'; +export 'src/model/async_task/async_task.dart'; export 'src/model/audit/audit_log_action_detail.dart'; +export 'src/model/audit/audit_log_action_field.dart'; export 'src/model/audit/audit_log_action_message.dart'; export 'src/model/audit/audit_log_action_message_param.dart'; export 'src/model/audit/audit_log_entry.dart'; @@ -60,6 +62,11 @@ export 'src/model/audit/client_log_action.dart'; export 'src/model/audit/copy_context_id.dart'; export 'src/model/audit/log_action.dart'; export 'src/model/audit/log_action_cause.dart'; +export 'src/model/audit/upload_request/upload_request_audit_log_action_field.dart'; +export 'src/model/audit/upload_request/upload_request_audit_log_entry.dart'; +export 'src/model/audit/upload_request/upload_request_entry_audit_log_entry.dart'; +export 'src/model/audit/upload_request/upload_request_entry_copy.dart'; +export 'src/model/audit/upload_request/upload_request_url_audit_log_entry.dart'; export 'src/model/audit/work_group_copy.dart'; export 'src/model/audit/work_group_light.dart'; export 'src/model/audit/workgroup/shared_space_member_audit_log_entry.dart'; @@ -67,18 +74,18 @@ export 'src/model/audit/workgroup/shared_space_node_audit_log_entry.dart'; export 'src/model/audit/workgroup/work_group_document_audit_log_entry.dart'; export 'src/model/audit/workgroup/work_group_document_revision_audit_log_entry.dart'; export 'src/model/audit/workgroup/work_group_folder_audit_log_entry.dart'; -export 'src/model/audit/upload_request/upload_request_audit_log_entry.dart'; -export 'src/model/audit/upload_request/upload_request_url_audit_log_entry.dart'; -export 'src/model/audit/upload_request/upload_request_audit_log_action_field.dart'; -export 'src/model/audit/upload_request/upload_request_entry_audit_log_entry.dart'; -export 'src/model/audit/upload_request/upload_request_entry_copy.dart'; -export 'src/model/audit/audit_log_action_field.dart'; +export 'src/model/authentication/oidc_configuration.dart'; export 'src/model/authentication/oidc_configuration.dart'; export 'src/model/authentication/otp_code.dart'; +export 'src/model/authentication/plan_request.dart'; +export 'src/model/authentication/saas_configuration.dart'; +export 'src/model/authentication/saas_secret_token.dart'; +export 'src/model/authentication/saas_type.dart'; +export 'src/model/authentication/signup_request.dart'; export 'src/model/authentication/token.dart'; export 'src/model/authentication/token_id.dart'; export 'src/model/authentication/token_oidc.dart'; -export 'src/model/authentication/oidc_configuration.dart'; +export 'src/model/authentication/user_saas.dart'; export 'src/model/autocomplete/autocomplete_pattern.dart'; export 'src/model/autocomplete/autocomplete_result.dart'; export 'src/model/autocomplete/autocomplete_result_type.dart'; @@ -95,6 +102,7 @@ export 'src/model/biometric_authentication/biometric_kind.dart'; export 'src/model/biometric_authentication/biometric_state.dart'; export 'src/model/biometric_authentication/ios_setting_arguments.dart'; export 'src/model/biometric_authentication/support_biometric_state.dart'; +export 'src/model/constant.dart'; export 'src/model/contact/contact.dart'; export 'src/model/contact/device_contact.dart'; export 'src/model/copy/copy_request.dart'; @@ -106,6 +114,9 @@ export 'src/model/document/document_id.dart'; export 'src/model/document/document_id.dart'; export 'src/model/file_info.dart'; export 'src/model/file_info.dart'; +export 'src/model/flow/flow.dart'; +export 'src/model/flow/flow_chunk.dart'; +export 'src/model/flow/flow_file.dart'; export 'src/model/functionality/functionality.dart'; export 'src/model/functionality/functionality_boolean.dart'; export 'src/model/functionality/functionality_identifier.dart'; @@ -123,6 +134,8 @@ export 'src/model/linshare_node_type.dart'; export 'src/model/myspace/edit_description_document_request.dart'; export 'src/model/myspace/rename_document_request.dart'; export 'src/model/offline_mode/offline_mode_action_result.dart'; +export 'src/model/offline_mode/offline_mode_action_result.dart'; +export 'src/model/offline_mode/sync_offline_state.dart'; export 'src/model/offline_mode/sync_offline_state.dart'; export 'src/model/operation.dart'; export 'src/model/password.dart'; @@ -145,11 +158,14 @@ export 'src/model/share/share.dart'; export 'src/model/share/share.dart'; export 'src/model/share/share_id.dart'; export 'src/model/share/share_id.dart'; +export 'src/model/sharedspace/create_drive_request.dart'; export 'src/model/sharedspace/create_work_group_request.dart'; +export 'src/model/sharedspace/create_work_space_request.dart'; +export 'src/model/sharedspace/enable_versioning_work_group_request.dart'; export 'src/model/sharedspace/enable_versioning_work_group_request.dart'; export 'src/model/sharedspace/members_parameter.dart'; -export 'src/model/sharedspace/rename_work_group_request.dart'; export 'src/model/sharedspace/rename_drive_request.dart'; +export 'src/model/sharedspace/rename_work_group_request.dart'; export 'src/model/sharedspace/rename_work_space_request.dart'; export 'src/model/sharedspace/roles_parameter.dart'; export 'src/model/sharedspace/shared_space_id.dart'; @@ -157,6 +173,7 @@ export 'src/model/sharedspace/shared_space_member.dart'; export 'src/model/sharedspace/shared_space_member_id.dart'; export 'src/model/sharedspace/shared_space_member_node.dart'; export 'src/model/sharedspace/shared_space_node_nested.dart'; +export 'src/model/sharedspace/shared_space_node_nested.dart'; export 'src/model/sharedspace/shared_space_operation_role.dart'; export 'src/model/sharedspace/shared_space_role.dart'; export 'src/model/sharedspace/shared_space_role_id.dart'; @@ -166,33 +183,49 @@ export 'src/model/sharedspace/versioning_parameter.dart'; export 'src/model/sharedspacedocument/move_work_group_node_request.dart'; export 'src/model/sharedspacedocument/rename_work_group_node_request.dart'; export 'src/model/sharedspacedocument/tree_node.dart'; +export 'src/model/sharedspacedocument/tree_node.dart'; export 'src/model/sharedspacedocument/work_group_document.dart'; export 'src/model/sharedspacedocument/work_group_folder.dart'; export 'src/model/sharedspacedocument/work_group_node.dart'; export 'src/model/sharedspacedocument/work_group_node_id.dart'; export 'src/model/sharedspacedocument/work_group_node_parent_id.dart'; +export 'src/model/sharedspacedocument/work_group_node_parent_id.dart'; export 'src/model/sharedspacedocument/work_group_node_type.dart'; export 'src/model/sharedspacemember/add_shared_space_member_request.dart'; -export 'src/model/sharedspacemember/update_shared_space_member_request.dart'; export 'src/model/sharedspacemember/update_drive_member_request.dart'; +export 'src/model/sharedspacemember/update_shared_space_member_request.dart'; export 'src/model/sharedspacemember/update_workspace_member_request.dart'; export 'src/model/sort/order_by.dart'; export 'src/model/sort/order_screen.dart'; export 'src/model/sort/order_type.dart'; export 'src/model/sort/sorter.dart'; export 'src/model/suggestion/suggest_name_type.dart'; +export 'src/model/upload_request/edit_upload_request_recipient.dart'; +export 'src/model/upload_request/upload_proposition_request_id.dart'; +export 'src/model/upload_request/upload_request.dart'; export 'src/model/upload_request/upload_request.dart'; export 'src/model/upload_request/upload_request_id.dart'; -export 'src/model/upload_request/edit_upload_request_recipient.dart'; +export 'src/model/upload_request/upload_request_id.dart'; +export 'src/model/upload_request/upload_request_url.dart'; export 'src/model/upload_request_entry/upload_request_entry.dart'; +export 'src/model/upload_request_entry/upload_request_entry.dart'; +export 'src/model/upload_request_entry/upload_request_entry_id.dart'; export 'src/model/upload_request_entry/upload_request_entry_id.dart'; export 'src/model/upload_request_entry/upload_request_entry_owner.dart'; +export 'src/model/upload_request_entry/upload_request_entry_owner.dart'; +export 'src/model/upload_request_entry/upload_request_entry_owner_id.dart'; export 'src/model/upload_request_entry/upload_request_entry_owner_id.dart'; export 'src/model/upload_request_group/add_upload_request.dart'; +export 'src/model/upload_request_group/add_upload_request.dart'; export 'src/model/upload_request_group/edit_upload_request.dart'; +export 'src/model/upload_request_group/edit_upload_request.dart'; +export 'src/model/upload_request_group/upload_request_creation_type.dart'; export 'src/model/upload_request_group/upload_request_creation_type.dart'; export 'src/model/upload_request_group/upload_request_group.dart'; +export 'src/model/upload_request_group/upload_request_group.dart'; export 'src/model/upload_request_group/upload_request_group_id.dart'; +export 'src/model/upload_request_group/upload_request_group_id.dart'; +export 'src/model/upload_request_group/upload_request_status.dart'; export 'src/model/upload_request_group/upload_request_status.dart'; export 'src/model/user/user.dart'; export 'src/model/user/user_id.dart'; @@ -201,84 +234,48 @@ export 'src/model/user_name.dart'; export 'src/model/user_name.dart'; export 'src/model/verification/composite_name_validator.dart'; export 'src/model/verification/duplicate_name_validator.dart'; -export 'src/model/verification/empty_name_validator.dart'; export 'src/model/verification/empty_login_email_validator.dart'; export 'src/model/verification/empty_login_password_validator.dart'; export 'src/model/verification/empty_login_url_validator.dart'; +export 'src/model/verification/empty_name_validator.dart'; export 'src/model/verification/empty_signup_name_validator.dart'; export 'src/model/verification/empty_signup_surname_validator.dart'; -export 'src/model/verification/password_special_character_validator.dart'; -export 'src/model/verification/login_email_validator.dart'; export 'src/model/verification/last_dot_validator.dart'; +export 'src/model/verification/login_email_validator.dart'; export 'src/model/verification/new_name_request.dart'; +export 'src/model/verification/password_special_character_validator.dart'; export 'src/model/verification/special_character_validator.dart'; export 'src/model/verification/validator.dart'; export 'src/network/service_path.dart'; export 'src/network/service_path.dart'; -export 'src/model/offline_mode/sync_offline_state.dart'; -export 'src/model/offline_mode/offline_mode_action_result.dart'; -export 'src/model/sharedspacedocument/tree_node.dart'; -export 'src/model/sharedspacedocument/work_group_node_parent_id.dart'; -export 'src/model/upload_request/upload_request.dart'; -export 'src/model/upload_request/upload_request_url.dart'; -export 'src/model/upload_request/upload_proposition_request_id.dart'; -export 'src/model/upload_request_group/upload_request_group.dart'; -export 'src/model/upload_request_group/upload_request_status.dart'; -export 'src/model/upload_request_group/upload_request_group_id.dart'; -export 'src/model/upload_request/upload_request_id.dart'; -export 'src/model/upload_request_entry/upload_request_entry_id.dart'; -export 'src/model/upload_request_group/upload_request_creation_type.dart'; -export 'src/model/upload_request_group/add_upload_request.dart'; -export 'src/model/upload_request_group/edit_upload_request.dart'; -export 'src/model/upload_request_entry/upload_request_entry.dart'; -export 'src/model/upload_request_entry/upload_request_entry_owner.dart'; -export 'src/model/upload_request_entry/upload_request_entry_owner_id.dart'; -export 'src/model/account/last_login.dart'; -export 'src/model/sharedspace/enable_versioning_work_group_request.dart'; -export 'src/model/sharedspace/shared_space_node_nested.dart'; export 'src/repository/audit/audit_user_repository.dart'; export 'src/repository/authentication/authentication_oidc_repository.dart'; -export 'src/model/sharedspace/create_drive_request.dart'; -export 'src/model/sharedspace/create_work_space_request.dart'; -export 'src/model/authentication/saas_configuration.dart'; -export 'src/model/authentication/saas_type.dart'; -export 'src/model/authentication/saas_secret_token.dart'; -export 'src/model/authentication/signup_request.dart'; -export 'src/model/authentication/user_saas.dart'; -export 'src/model/authentication/plan_request.dart'; -export 'src/model/flow/flow_chunk.dart'; -export 'src/model/flow/flow_file.dart'; -export 'src/usecases/upload_file/flow_upload_state.dart'; -export 'src/model/flow/flow.dart'; -export 'src/model/async_task/async_task.dart'; -export 'src/model/app_mode.dart'; - +export 'src/repository/authentication/authentication_oidc_repository.dart'; // repository export 'src/repository/authentication/authentication_repository.dart'; -export 'src/repository/authentication/authentication_oidc_repository.dart'; export 'src/repository/authentication/credential_repository.dart'; +export 'src/repository/authentication/saas_console_repository.dart'; export 'src/repository/authentication/token_repository.dart'; export 'src/repository/autocomplete/autocomplete_repository.dart'; export 'src/repository/biometric_authentication/biometric_repository.dart'; export 'src/repository/contact/contact_repository.dart'; export 'src/repository/document/document_repository.dart'; +export 'src/repository/endpoint/api_repository.dart'; +export 'src/repository/flow/flow_uploader.dart'; export 'src/repository/functionality/functionality_repository.dart'; export 'src/repository/quota/quota_repository.dart'; export 'src/repository/received/received_share_repository.dart'; +export 'src/repository/settings/setting_repository.dart'; +export 'src/repository/settings/settings_exceptions.dart'; export 'src/repository/shared_space_activities/shared_space_acitivities_repository.dart'; export 'src/repository/sharedspace/shared_space_repository.dart'; export 'src/repository/sharedspacedocument/shared_space_document_repository.dart'; export 'src/repository/sharedspacemember/shared_space_member_repository.dart'; export 'src/repository/sort/sort_repository.dart'; -export 'src/repository/upload_request_group/upload_request_group_repository.dart'; export 'src/repository/upload_request/upload_request_repository.dart'; export 'src/repository/upload_request_entry/upload_request_entry_repository.dart'; +export 'src/repository/upload_request_group/upload_request_group_repository.dart'; export 'src/repository/workgroup/shared_space_node_repository.dart'; -export 'src/repository/authentication/saas_console_repository.dart'; -export 'src/repository/endpoint/api_repository.dart'; -export 'src/repository/flow/flow_uploader.dart'; -export 'src/repository/settings/setting_repository.dart'; - // viewState export 'src/state/failure.dart'; export 'src/state/success.dart'; @@ -287,25 +284,29 @@ export 'src/usecases/audit_user/audit_user_view_state.dart'; export 'src/usecases/audit_user/audit_user_view_state.dart'; export 'src/usecases/audit_user/get_last_login_interactor.dart'; export 'src/usecases/audit_user/get_last_login_interactor.dart'; -export 'src/usecases/authentication/saas_configuration_view_state.dart'; - +export 'src/usecases/audit_user/save_last_login_interactor.dart'; // exception export 'src/usecases/authentication/authentication_exception.dart'; export 'src/usecases/authentication/authentication_view_state.dart'; -export 'src/repository/settings/settings_exceptions.dart'; -export 'src/usecases/workgroup/workgroup_exception.dart'; - // interactor export 'src/usecases/authentication/create_permanent_token_interactor.dart'; export 'src/usecases/authentication/create_permanent_token_oidc_interactor.dart'; export 'src/usecases/authentication/credential_view_state.dart'; export 'src/usecases/authentication/delete_permanent_token_interactor.dart'; +export 'src/usecases/authentication/delete_token_oidc_interactor.dart'; export 'src/usecases/authentication/get_authorized_user_interactor.dart'; export 'src/usecases/authentication/get_credential_interactor.dart'; export 'src/usecases/authentication/get_oidc_configuration_interactor.dart'; +export 'src/usecases/authentication/get_oidc_configuration_interactor.dart'; +export 'src/usecases/authentication/get_saas_configuration_interactor.dart'; +export 'src/usecases/authentication/get_secret_token_interactor.dart'; export 'src/usecases/authentication/get_token_oidc_interactor.dart'; +export 'src/usecases/authentication/log_out_oidc_interactor.dart'; export 'src/usecases/authentication/logout_exception.dart'; export 'src/usecases/authentication/logout_view_state.dart'; +export 'src/usecases/authentication/saas_configuration_view_state.dart'; +export 'src/usecases/authentication/save_authorized_user_interactor.dart'; +export 'src/usecases/authentication/sign_up_for_saas_interactor.dart'; export 'src/usecases/authentication/user_exception.dart'; export 'src/usecases/autocomplete/autocomplete_exception.dart'; export 'src/usecases/autocomplete/autocomplete_view_state.dart'; @@ -364,7 +365,10 @@ export 'src/usecases/quota/quota_exception.dart'; export 'src/usecases/quota/quota_verification_exception.dart'; export 'src/usecases/quota/quota_verification_view_state.dart'; export 'src/usecases/quota/quota_view_state.dart'; +export 'src/usecases/quota/save_quota_interactor.dart'; export 'src/usecases/received/copy_multiple_files_from_received_shares_to_my_space_interactor.dart'; +export 'src/usecases/received/disable_offline_received_share_interactor.dart'; +export 'src/usecases/received/disable_offline_received_share_view_state.dart'; export 'src/usecases/received/download_preview_received_share_interactor.dart'; export 'src/usecases/received/download_preview_received_share_view_state.dart'; export 'src/usecases/received/download_received_shares_interactor.dart'; @@ -376,8 +380,6 @@ export 'src/usecases/received/get_all_received_shares_interactor.dart'; export 'src/usecases/received/get_received_share_interactor.dart'; export 'src/usecases/received/make_received_share_offline_interactor.dart'; export 'src/usecases/received/make_received_share_offline_view_state.dart'; -export 'src/usecases/received/disable_offline_received_share_interactor.dart'; -export 'src/usecases/received/disable_offline_received_share_view_state.dart'; export 'src/usecases/received/received_share_exception.dart'; export 'src/usecases/received/received_share_view_state.dart'; export 'src/usecases/received/remove_multiple_received_shares_interactor.dart'; @@ -390,6 +392,8 @@ export 'src/usecases/search_document/search_document_view_state.dart'; export 'src/usecases/search_received_shares/search_received_shares_interactor.dart'; export 'src/usecases/search_received_shares/search_received_shares_interactor.dart'; export 'src/usecases/search_received_shares/search_received_shares_view_state.dart'; +export 'src/usecases/search_recipients_upload_request/search_recipients_upload_request_interactor.dart'; +export 'src/usecases/search_recipients_upload_request/search_recipients_upload_request_view_state.dart'; export 'src/usecases/search_shared_space_node_nested/search_shared_space_node_nested_interactor.dart'; export 'src/usecases/search_shared_space_node_nested/search_shared_space_node_nested_view_state.dart'; export 'src/usecases/search_upload_request_groups/search_upload_request_groups_interactor.dart'; @@ -398,16 +402,23 @@ export 'src/usecases/search_upload_request_inside/search_upload_request_entries_ export 'src/usecases/search_upload_request_inside/search_upload_request_entries_interactor.dart'; export 'src/usecases/search_upload_request_inside/search_upload_request_entries_view_state.dart'; export 'src/usecases/search_upload_request_inside/search_upload_request_entries_view_state.dart'; +export 'src/usecases/search_workgroup_inside_shared_space_node/search_workgroup_inside_shared_space_node_interactor.dart'; +export 'src/usecases/search_workgroup_inside_shared_space_node/search_workgroup_inside_shared_space_node_view_state.dart'; export 'src/usecases/search_workgroup_node/advance_search_workgroup_node_exception.dart'; export 'src/usecases/search_workgroup_node/advance_search_workgroup_node_interactor.dart'; export 'src/usecases/search_workgroup_node/search_workgroup_node_interactor.dart'; export 'src/usecases/search_workgroup_node/search_workgroup_node_view_state.dart'; +export 'src/usecases/settings/get_app_mode_interactor.dart'; +export 'src/usecases/settings/set_app_mode_interactor.dart'; +export 'src/usecases/settings/settings_view_state.dart'; export 'src/usecases/share/share_document_exception.dart'; export 'src/usecases/share/share_document_interactor.dart'; export 'src/usecases/share/share_document_view_state.dart'; export 'src/usecases/shared_space/add_shared_space_member_interactor.dart'; export 'src/usecases/shared_space/copy_multiple_files_to_shared_space_interactor.dart'; export 'src/usecases/shared_space/copy_to_shared_space_interactor.dart'; +export 'src/usecases/shared_space/create_new_drive_interactor.dart'; +export 'src/usecases/shared_space/create_new_work_space_interactor.dart'; export 'src/usecases/shared_space/create_shared_space_folder_interactor.dart'; export 'src/usecases/shared_space/create_work_group_interactor.dart'; export 'src/usecases/shared_space/delete_shared_space_member_interactor.dart'; @@ -433,16 +444,16 @@ export 'src/usecases/shared_space/remove_multiple_shared_space_nodes_interactor. export 'src/usecases/shared_space/remove_multiple_shared_spaces_interactor.dart'; export 'src/usecases/shared_space/remove_shared_space_interactor.dart'; export 'src/usecases/shared_space/remove_shared_space_node_interactor.dart'; +export 'src/usecases/shared_space/rename_drive_interactor.dart'; export 'src/usecases/shared_space/rename_shared_space_node_interactor.dart'; export 'src/usecases/shared_space/rename_work_group_interactor.dart'; -export 'src/usecases/shared_space/rename_drive_interactor.dart'; export 'src/usecases/shared_space/rename_work_space_interactor.dart'; export 'src/usecases/shared_space/restore_work_group_document_version_interactor.dart'; export 'src/usecases/shared_space/shared_space_exception.dart'; export 'src/usecases/shared_space/shared_space_member_exception.dart'; export 'src/usecases/shared_space/shared_space_view_state.dart'; -export 'src/usecases/shared_space/update_shared_space_member_interactor.dart'; export 'src/usecases/shared_space/update_drive_member_interactor.dart'; +export 'src/usecases/shared_space/update_shared_space_member_interactor.dart'; export 'src/usecases/shared_space/update_workspace_member_interactor.dart'; export 'src/usecases/shared_space_activities/shared_space_activities_exception.dart'; export 'src/usecases/shared_space_activities/shared_space_activities_interactor.dart'; @@ -462,22 +473,29 @@ export 'src/usecases/sort/save_sorter_interactor.dart'; export 'src/usecases/sort/sort_interactor.dart'; export 'src/usecases/sort/sort_view_state.dart'; export 'src/usecases/upload_file/file_upload_state.dart'; +export 'src/usecases/upload_file/flow_upload_document_interactor.dart'; +export 'src/usecases/upload_file/flow_upload_state.dart'; +export 'src/usecases/upload_file/flow_upload_work_group_document_interactor.dart'; +export 'src/usecases/upload_request/edit_upload_request_recipient_interactor.dart'; export 'src/usecases/upload_request/get_all_upload_requests_interactor.dart'; +export 'src/usecases/upload_request/get_upload_request_activities_interactor.dart'; +export 'src/usecases/upload_request/get_upload_request_interactor.dart'; export 'src/usecases/upload_request/update_upload_request_multiple_status_interactor.dart'; export 'src/usecases/upload_request/update_upload_request_status_interactor.dart'; export 'src/usecases/upload_request/upload_request_exception.dart'; export 'src/usecases/upload_request/upload_request_view_state.dart'; -export 'src/usecases/upload_request/get_upload_request_interactor.dart'; -export 'src/usecases/upload_request/edit_upload_request_recipient_interactor.dart'; -export 'src/usecases/upload_request/get_upload_request_activities_interactor.dart'; export 'src/usecases/upload_request_entry/copy_multiple_files_from_upload_request_entries_to_my_space_interactor.dart'; export 'src/usecases/upload_request_entry/copy_multiple_files_from_upload_request_entries_to_my_space_interactor.dart'; export 'src/usecases/upload_request_entry/download_multiple_upload_request_entry_ios_interactor.dart'; export 'src/usecases/upload_request_entry/download_upload_request_entry_interactor.dart'; +export 'src/usecases/upload_request_entry/download_upload_request_entry_interactor.dart'; export 'src/usecases/upload_request_entry/download_upload_request_entry_ios_interactor.dart'; export 'src/usecases/upload_request_entry/get_all_upload_request_entries_interactor.dart'; +export 'src/usecases/upload_request_entry/get_upload_request_entry_activities_interactor.dart'; +export 'src/usecases/upload_request_entry/remove_multiple_upload_request_entry_interactor.dart'; export 'src/usecases/upload_request_entry/remove_multiple_upload_request_entry_interactor.dart'; export 'src/usecases/upload_request_entry/remove_upload_request_entry_interactor.dart'; +export 'src/usecases/upload_request_entry/remove_upload_request_entry_interactor.dart'; export 'src/usecases/upload_request_entry/upload_request_entry_exception.dart'; export 'src/usecases/upload_request_entry/upload_request_entry_view_state.dart'; export 'src/usecases/upload_request_group/add_new_upload_request_interactor.dart'; @@ -489,30 +507,7 @@ export 'src/usecases/upload_request_group/update_upload_request_group_status_int export 'src/usecases/upload_request_group/update_upload_request_multiple_group_status_interactor.dart'; export 'src/usecases/upload_request_group/upload_request_group_exception.dart'; export 'src/usecases/upload_request_group/upload_request_group_view_state.dart'; -export 'src/usecases/upload_request_entry/remove_multiple_upload_request_entry_interactor.dart'; -export 'src/usecases/upload_request_entry/remove_upload_request_entry_interactor.dart'; -export 'src/usecases/upload_request_entry/get_upload_request_entry_activities_interactor.dart'; -export 'src/usecases/authentication/get_oidc_configuration_interactor.dart'; -export 'src/usecases/search_workgroup_inside_shared_space_node/search_workgroup_inside_shared_space_node_interactor.dart'; -export 'src/usecases/search_workgroup_inside_shared_space_node/search_workgroup_inside_shared_space_node_view_state.dart'; export 'src/usecases/workgroup/get_all_workgroups_interactor.dart'; -export 'src/usecases/workgroup/workgroup_view_state.dart'; export 'src/usecases/workgroup/get_all_workgroups_offline_interactor.dart'; -export 'src/usecases/shared_space/create_new_drive_interactor.dart'; -export 'src/usecases/shared_space/create_new_work_space_interactor.dart'; -export 'src/usecases/quota/save_quota_interactor.dart'; -export 'src/usecases/audit_user/save_last_login_interactor.dart'; -export 'src/usecases/authentication/save_authorized_user_interactor.dart'; -export 'src/usecases/search_recipients_upload_request/search_recipients_upload_request_interactor.dart'; -export 'src/usecases/search_recipients_upload_request/search_recipients_upload_request_view_state.dart'; -export 'src/usecases/upload_request_entry/download_upload_request_entry_interactor.dart'; -export 'src/usecases/authentication/get_saas_configuration_interactor.dart'; -export 'src/usecases/authentication/get_secret_token_interactor.dart'; -export 'src/usecases/authentication/sign_up_for_saas_interactor.dart'; -export 'src/usecases/authentication/log_out_oidc_interactor.dart'; -export 'src/usecases/authentication/delete_token_oidc_interactor.dart'; -export 'src/usecases/upload_file/flow_upload_document_interactor.dart'; -export 'src/usecases/upload_file/flow_upload_work_group_document_interactor.dart'; -export 'src/usecases/settings/get_app_mode_interactor.dart'; -export 'src/usecases/settings/settings_view_state.dart'; -export 'src/usecases/settings/set_app_mode_interactor.dart'; +export 'src/usecases/workgroup/workgroup_exception.dart'; +export 'src/usecases/workgroup/workgroup_view_state.dart'; diff --git a/domain/lib/src/model/authentication/oidc_configuration.dart b/domain/lib/src/model/authentication/oidc_configuration.dart index dcb0712c8..1bbb33f32 100644 --- a/domain/lib/src/model/authentication/oidc_configuration.dart +++ b/domain/lib/src/model/authentication/oidc_configuration.dart @@ -40,6 +40,7 @@ class OIDCConfiguration extends Equatable { final String redirectUrl = redirectOidc; final String logoutRedirectUri; final String responseType; + final String oidcTokenType; final List scopes; OIDCConfiguration({ @@ -47,6 +48,7 @@ class OIDCConfiguration extends Equatable { required this.clientId, required this.logoutRedirectUri, required this.responseType, + required this.oidcTokenType, required this.scopes }); @@ -59,5 +61,5 @@ class OIDCConfiguration extends Equatable { } @override - List get props => [authority, clientId, redirectUrl, scopes]; + List get props => [authority, clientId, redirectUrl, oidcTokenType, scopes]; } diff --git a/domain/lib/src/model/authentication/token_oidc.dart b/domain/lib/src/model/authentication/token_oidc.dart index 423843548..a880a47b6 100644 --- a/domain/lib/src/model/authentication/token_oidc.dart +++ b/domain/lib/src/model/authentication/token_oidc.dart @@ -33,15 +33,16 @@ import 'package:domain/domain.dart'; import 'package:equatable/equatable.dart'; class TokenOIDC extends Equatable { - const TokenOIDC(this.token, this.tokenId, this.expiredTime, this.refreshToken); + const TokenOIDC(this.token, this.tokenId, this.expiredTime, this.refreshToken, this.oidcTokenType); final String token; final TokenId tokenId; final DateTime expiredTime; final String refreshToken; + final String oidcTokenType; @override - List get props => [token, tokenId, expiredTime, refreshToken]; + List get props => [token, tokenId, expiredTime, refreshToken, oidcTokenType]; @override bool get stringify => true; diff --git a/domain/lib/src/model/constant.dart b/domain/lib/src/model/constant.dart new file mode 100644 index 000000000..77fd9dda5 --- /dev/null +++ b/domain/lib/src/model/constant.dart @@ -0,0 +1,38 @@ +/* + * LinShare is an open source filesharing software, part of the LinPKI software + * suite, developed by Linagora. + * + * Copyright (C) 2023 LINAGORA + * + * This program is free software: you can redistribute it and/or modify it under the + * terms of the GNU Affero General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later version, + * provided you comply with the Additional Terms applicable for LinShare software by + * Linagora pursuant to Section 7 of the GNU Affero General Public License, + * subsections (b), (c), and (e), pursuant to which you must notably (i) retain the + * display in the interface of the “LinShare™” trademark/logo, the "Libre & Free" mention, + * the words “You are using the Free and Open Source version of LinShare™, powered by + * Linagora © 2009–2021. Contribute to Linshare R&D by subscribing to an Enterprise + * offer!”. You must also retain the latter notice in all asynchronous messages such as + * e-mails sent with the Program, (ii) retain all hypertext links between LinShare and + * http://www.linshare.org, between linagora.com and Linagora, and (iii) refrain from + * infringing Linagora intellectual property rights over its trademarks and commercial + * brands. Other Additional Terms apply, see + * + * for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * You should have received a copy of the GNU Affero General Public License and its + * applicable Additional Terms for LinShare along with this program. If not, see + * for the GNU Affero General Public License version + * 3 and for + * the Additional Terms applicable to LinShare software. + */ + +class DomainConstant { + static const opaqueOidc = 'Oidc-Opaque'; + static const jwtOidc = 'Oidc-Jwt'; +} + diff --git a/domain/lib/src/repository/authentication/authentication_oidc_repository.dart b/domain/lib/src/repository/authentication/authentication_oidc_repository.dart index c76d26adb..3f55e70de 100644 --- a/domain/lib/src/repository/authentication/authentication_oidc_repository.dart +++ b/domain/lib/src/repository/authentication/authentication_oidc_repository.dart @@ -37,6 +37,7 @@ abstract class AuthenticationOIDCRepository { String clientId, String redirectUrl, String discoveryUrl, + String oidcTokenType, List scopes, bool preferEphemeralSessionIOS, List? promptValues, diff --git a/domain/lib/src/usecases/authentication/get_token_oidc_interactor.dart b/domain/lib/src/usecases/authentication/get_token_oidc_interactor.dart index de3d32daf..7a128758c 100644 --- a/domain/lib/src/usecases/authentication/get_token_oidc_interactor.dart +++ b/domain/lib/src/usecases/authentication/get_token_oidc_interactor.dart @@ -45,6 +45,7 @@ class GetTokenOIDCInteractor { String clientId, String redirectUrl, String discoveryUrl, + String oidcTokenType, List scopes, bool preferEphemeralSessionIOS, List? promptValues, @@ -56,6 +57,7 @@ class GetTokenOIDCInteractor { clientId, redirectUrl, discoveryUrl, + oidcTokenType, scopes, preferEphemeralSessionIOS, promptValues, diff --git a/domain/test/fixture/test_fixture.dart b/domain/test/fixture/test_fixture.dart index c78a4c986..c227e6d82 100644 --- a/domain/test/fixture/test_fixture.dart +++ b/domain/test/fixture/test_fixture.dart @@ -31,6 +31,7 @@ // import 'package:domain/domain.dart'; +import 'package:domain/src/model/constant.dart'; import 'package:domain/src/model/quota/quota_id.dart'; import 'package:http_parser/http_parser.dart'; @@ -47,8 +48,8 @@ final password1 = Password('qwedsazxc'); final userName2 = UserName('user2@linshare.org'); final password2 = Password('qwedsasca'); final permanentToken = Token(permanentTokenString, TokenId(tokenUUID)); -final oidcToken = TokenOIDC('afbe3891a4e1b48f4b4d3bbb1962ba86', TokenId('uuid'), DateTime.now(), 'refresh-token'); -final oidcTokenWrong = TokenOIDC('abc123', TokenId('uuid'), DateTime.now(), 'refresh-token'); +final oidcToken = TokenOIDC('afbe3891a4e1b48f4b4d3bbb1962ba86', TokenId('uuid'), DateTime.now(), 'refresh-token', DomainConstant.opaqueOidc); +final oidcTokenWrong = TokenOIDC('abc123', TokenId('uuid'), DateTime.now(), 'refresh-token', DomainConstant.opaqueOidc); const baseUrlSupported = 'https://linshare-integration-4-files.linagora.com/'; final linShareOIDCFilesBaseUrl = Uri.parse(baseUrlSupported); diff --git a/lib/presentation/widget/login/login_viewmodel.dart b/lib/presentation/widget/login/login_viewmodel.dart index a2ce55c91..2f7070800 100644 --- a/lib/presentation/widget/login/login_viewmodel.dart +++ b/lib/presentation/widget/login/login_viewmodel.dart @@ -251,6 +251,7 @@ class LoginViewModel extends BaseViewModel { oidcConfiguration.clientId, oidcConfiguration.redirectUrl, oidcConfiguration.discoveryUrl, + oidcConfiguration.oidcTokenType, oidcConfiguration.scopes, AuthenticationOIDCConfig.preferEphemeralSessionIOS, null, @@ -264,6 +265,7 @@ class LoginViewModel extends BaseViewModel { String clientId, String redirectUrl, String discoveryUrl, + String oidcTokenType, List scopes, bool preferEphemeralSessionIOS, List? promptValues, @@ -279,7 +281,7 @@ class LoginViewModel extends BaseViewModel { } await _getTokenOIDCInteractor - .execute(clientId, redirectUrl, discoveryUrl, scopes, preferEphemeralSessionIOS, promptValues, allowInsecureConnections) + .execute(clientId, redirectUrl, discoveryUrl, oidcTokenType, scopes, preferEphemeralSessionIOS, promptValues, allowInsecureConnections) .then((result) => result.fold( (failure) { if (failure is GetTokenOIDCFailure) { diff --git a/lib/presentation/widget/sign_up/sign_up_viewmodel.dart b/lib/presentation/widget/sign_up/sign_up_viewmodel.dart index 6231c9fc3..12b9d96bf 100644 --- a/lib/presentation/widget/sign_up/sign_up_viewmodel.dart +++ b/lib/presentation/widget/sign_up/sign_up_viewmodel.dart @@ -338,6 +338,7 @@ class SignUpViewModel extends BaseViewModel { oidcConfiguration.clientId, oidcConfiguration.redirectUrl, oidcConfiguration.discoveryUrl, + oidcConfiguration.oidcTokenType, oidcConfiguration.scopes, AuthenticationOIDCConfig.preferEphemeralSessionIOS, AuthenticationOIDCConfig.promptValues, @@ -350,6 +351,7 @@ class SignUpViewModel extends BaseViewModel { String clientId, String redirectUrl, String discoveryUrl, + String oidcTokenType, List scopes, bool preferEphemeralSessionIOS, List? promptValues, @@ -360,7 +362,7 @@ class SignUpViewModel extends BaseViewModel { store.dispatch(StartSignUpAuthenticationLoadingAction()); await _getTokenOIDCInteractor - .execute(clientId, redirectUrl, discoveryUrl, scopes, preferEphemeralSessionIOS, promptValues, allowInsecureConnections) + .execute(clientId, redirectUrl, discoveryUrl, oidcTokenType, scopes, preferEphemeralSessionIOS, promptValues, allowInsecureConnections) .then((result) => result.fold( (failure) { if (failure is GetTokenOIDCFailure) {