TF-4145 Implement get oidc user_info from endpoint of oidc configuration

This commit is contained in:
dab246
2025-11-12 16:25:51 +07:00
committed by Dat H. Pham
parent 655a1bf81a
commit 43de7edd47
14 changed files with 185 additions and 6 deletions
@@ -2,6 +2,7 @@ import 'package:model/oidc/oidc_configuration.dart';
import 'package:model/oidc/request/oidc_request.dart';
import 'package:model/oidc/response/oidc_discovery_response.dart';
import 'package:model/oidc/response/oidc_response.dart';
import 'package:model/oidc/response/oidc_user_info.dart';
import 'package:model/oidc/token_id.dart';
import 'package:model/oidc/token_oidc.dart';
import 'package:tmail_ui_user/features/caching/utils/session_storage_manager.dart';
@@ -174,4 +175,14 @@ class AuthenticationOIDCDataSourceImpl extends AuthenticationOIDCDataSource {
);
}).catchError(_cacheExceptionThrower.throwException);
}
@override
Future<OidcUserInfo> fetchUserInfo(String userInfoEndpoint) {
return Future.sync(() async {
return await _oidcHttpClient.fetchUserInfo(userInfoEndpoint);
}).catchError((error, stackTrace) async {
await _exceptionThrower.throwException(error, stackTrace);
throw error;
});
}
}