From 9092e30b96e3ac073eecee7b3fd9be1e5eea5c75 Mon Sep 17 00:00:00 2001 From: dab246 Date: Tue, 7 Jun 2022 18:06:04 +0700 Subject: [PATCH] TF-624 Set clientId for oidc on browser --- lib/features/login/data/network/config/oidc_constant.dart | 5 +++++ lib/features/login/data/network/oidc_http_client.dart | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/features/login/data/network/config/oidc_constant.dart b/lib/features/login/data/network/config/oidc_constant.dart index 373f84c62..f1d8c0925 100644 --- a/lib/features/login/data/network/config/oidc_constant.dart +++ b/lib/features/login/data/network/config/oidc_constant.dart @@ -1,5 +1,10 @@ +import 'package:core/core.dart'; + class OIDCConstant { static String get mobileOidcClientId => 'teammail-mobile'; + static String get webOidcClientId => 'teammail-web'; static List get oidcScope => ['openid', 'offline_access']; static const keyAuthorityOidc = 'KEY_AUTHORITY_OIDC'; + + static String get clientId => BuildUtils.isWeb ? webOidcClientId : mobileOidcClientId; } \ No newline at end of file diff --git a/lib/features/login/data/network/oidc_http_client.dart b/lib/features/login/data/network/oidc_http_client.dart index 2ec658b13..4a0d8ccae 100644 --- a/lib/features/login/data/network/oidc_http_client.dart +++ b/lib/features/login/data/network/oidc_http_client.dart @@ -50,7 +50,7 @@ class OIDCHttpClient { log('OIDCHttpClient::getOIDCConfiguration(): href: ${oidcResponse.links[0].href}'); return OIDCConfiguration( authority: oidcResponse.links[0].href.toString(), - clientId: OIDCConstant.mobileOidcClientId, + clientId: OIDCConstant.clientId, scopes: OIDCConstant.oidcScope ); }