TF-3278 Handle open app via deep link at MailboxDashboard screen

This commit is contained in:
dab246
2024-11-22 23:30:37 +07:00
committed by Dat H. Pham
parent 8022559bc2
commit 223fdbf1fb
59 changed files with 1058 additions and 429 deletions
@@ -4,13 +4,17 @@ import 'package:tmail_ui_user/main/utils/app_config.dart';
class OIDCConstant {
static String get mobileOidcClientId => 'teammail-mobile';
static List<String> get oidcScope => ['openid', 'profile', 'email', 'offline_access'];
static const keyAuthorityOidc = 'KEY_AUTHORITY_OIDC';
static const authResponseKey = "auth_info";
static const String keyAuthorityOidc = 'KEY_AUTHORITY_OIDC';
static const String authResponseKey = "auth_info";
static const String twakeWorkplaceUrlScheme = 'twakemail.mobile';
static const String twakeWorkplaceRedirectUrl = '$twakeWorkplaceUrlScheme://redirect';
static const String appParameter = 'tmail';
static const String postRegisteredRedirectUrlPathParams = 'post_registered_redirect_url';
static const String postLoginRedirectUrlPathParams = 'post_login_redirect_url';
static const String endSessionFailedCode = 'end_session_failed';
static const String redirectOidcMobile = 'teammail.mobile://oauthredirect';
static const String loginRedirectOidcWeb = 'login-callback.html';
static const String logoutRedirectOidcWeb = 'logout-callback.html';
static String get clientId => PlatformInfo.isWeb ? AppConfig.webOidcClientId : mobileOidcClientId;
}
@@ -52,11 +52,14 @@ class OIDCHttpClient {
if (oidcResponse.links.isEmpty) {
throw CanNotFoundOIDCAuthority();
}
log('OIDCHttpClient::getOIDCConfiguration(): href: ${oidcResponse.links[0].href}');
final authority = oidcResponse.links[0].href.toString();
final isTWP = authority == AppConfig.saasRegistrationUrl;
log('OIDCHttpClient::getOIDCConfiguration():authority: $authority');
return OIDCConfiguration(
authority: oidcResponse.links[0].href.toString(),
authority: authority,
clientId: OIDCConstant.clientId,
scopes: AppConfig.oidcScopes
scopes: AppConfig.oidcScopes,
isTWP: isTWP,
);
}