TF-624 Remove baseUri param not use in GetOIDCConfigurationInteractor
This commit is contained in:
@@ -4,7 +4,7 @@ import 'package:model/model.dart';
|
|||||||
abstract class AuthenticationOIDCDataSource {
|
abstract class AuthenticationOIDCDataSource {
|
||||||
Future<OIDCResponse> checkOIDCIsAvailable(OIDCRequest oidcRequest);
|
Future<OIDCResponse> checkOIDCIsAvailable(OIDCRequest oidcRequest);
|
||||||
|
|
||||||
Future<OIDCConfiguration> getOIDCConfiguration(Uri baseUri, OIDCResponse oidcResponse);
|
Future<OIDCConfiguration> getOIDCConfiguration(OIDCResponse oidcResponse);
|
||||||
|
|
||||||
Future<TokenOIDC> getTokenOIDC(String clientId, String redirectUrl, String discoveryUrl, List<String> scopes);
|
Future<TokenOIDC> getTokenOIDC(String clientId, String redirectUrl, String discoveryUrl, List<String> scopes);
|
||||||
|
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ class AuthenticationOIDCDataSourceImpl extends AuthenticationOIDCDataSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<OIDCConfiguration> getOIDCConfiguration(Uri baseUri, OIDCResponse oidcResponse) {
|
Future<OIDCConfiguration> getOIDCConfiguration(OIDCResponse oidcResponse) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
return await _oidcHttpClient.getOIDCConfiguration(baseUri, oidcResponse);
|
return await _oidcHttpClient.getOIDCConfiguration(oidcResponse);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class OIDCHttpClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<OIDCConfiguration> getOIDCConfiguration(Uri baseUri, OIDCResponse oidcResponse) async {
|
Future<OIDCConfiguration> getOIDCConfiguration(OIDCResponse oidcResponse) async {
|
||||||
if (oidcResponse.links.isEmpty) {
|
if (oidcResponse.links.isEmpty) {
|
||||||
throw CanNotFoundOIDCAuthority();
|
throw CanNotFoundOIDCAuthority();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ class AuthenticationOIDCRepositoryImpl extends AuthenticationOIDCRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<OIDCConfiguration> getOIDCConfiguration(Uri baseUri, OIDCResponse oidcResponse) {
|
Future<OIDCConfiguration> getOIDCConfiguration(OIDCResponse oidcResponse) {
|
||||||
return _oidcDataSource.getOIDCConfiguration(baseUri, oidcResponse);
|
return _oidcDataSource.getOIDCConfiguration(oidcResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import 'package:model/model.dart';
|
|||||||
abstract class AuthenticationOIDCRepository {
|
abstract class AuthenticationOIDCRepository {
|
||||||
Future<OIDCResponse> checkOIDCIsAvailable(OIDCRequest oidcRequest);
|
Future<OIDCResponse> checkOIDCIsAvailable(OIDCRequest oidcRequest);
|
||||||
|
|
||||||
Future<OIDCConfiguration> getOIDCConfiguration(Uri baseUri, OIDCResponse oidcResponse);
|
Future<OIDCConfiguration> getOIDCConfiguration(OIDCResponse oidcResponse);
|
||||||
|
|
||||||
Future<TokenOIDC> getTokenOIDC(String clientId, String redirectUrl, String discoveryUrl, List<String> scopes);
|
Future<TokenOIDC> getTokenOIDC(String clientId, String redirectUrl, String discoveryUrl, List<String> scopes);
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ class GetOIDCConfigurationInteractor {
|
|||||||
|
|
||||||
GetOIDCConfigurationInteractor(this._oidcRepository);
|
GetOIDCConfigurationInteractor(this._oidcRepository);
|
||||||
|
|
||||||
Future<Either<Failure, Success>> execute(Uri baseUri, OIDCResponse oidcResponse) async {
|
Future<Either<Failure, Success>> execute(OIDCResponse oidcResponse) async {
|
||||||
try {
|
try {
|
||||||
final oidcConfiguration = await _oidcRepository.getOIDCConfiguration(baseUri, oidcResponse);
|
final oidcConfiguration = await _oidcRepository.getOIDCConfiguration(oidcResponse);
|
||||||
log('GetOIDCConfigurationInteractor::execute(): oidcConfiguration: $oidcConfiguration');
|
log('GetOIDCConfigurationInteractor::execute(): oidcConfiguration: $oidcConfiguration');
|
||||||
return Right<Failure, Success>(GetOIDCConfigurationSuccess(oidcConfiguration));
|
return Right<Failure, Success>(GetOIDCConfigurationSuccess(oidcConfiguration));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -106,12 +106,7 @@ class LoginController extends GetxController {
|
|||||||
void handleLoginPressed() {
|
void handleLoginPressed() {
|
||||||
log('LoginController::handleLoginPressed(): ${loginFormType.value}');
|
log('LoginController::handleLoginPressed(): ${loginFormType.value}');
|
||||||
if (loginFormType.value == LoginFormType.ssoForm) {
|
if (loginFormType.value == LoginFormType.ssoForm) {
|
||||||
final baseUri = kIsWeb ? _parseUri(AppConfig.baseUrl) : _parseUri(_urlText);
|
_getOIDCConfiguration();
|
||||||
if (baseUri != null) {
|
|
||||||
_getOIDCConfiguration(baseUri);
|
|
||||||
} else {
|
|
||||||
loginState.value = LoginState(Left(LoginMissUrlAction()));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
final baseUri = kIsWeb ? _parseUri(AppConfig.baseUrl) : _parseUri(_urlText);
|
final baseUri = kIsWeb ? _parseUri(AppConfig.baseUrl) : _parseUri(_urlText);
|
||||||
final userName = _parseUserName(_userNameText);
|
final userName = _parseUserName(_userNameText);
|
||||||
@@ -128,10 +123,10 @@ class LoginController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _getOIDCConfiguration(Uri baseUri) async {
|
void _getOIDCConfiguration() async {
|
||||||
loginState.value = LoginState(Right(LoginLoadingAction()));
|
loginState.value = LoginState(Right(LoginLoadingAction()));
|
||||||
if (_oidcResponse != null) {
|
if (_oidcResponse != null) {
|
||||||
await _getOIDCConfigurationInteractor.execute(baseUri, _oidcResponse!)
|
await _getOIDCConfigurationInteractor.execute(_oidcResponse!)
|
||||||
.then((response) => response.fold(
|
.then((response) => response.fold(
|
||||||
(failure) {
|
(failure) {
|
||||||
if (failure is GetOIDCConfigurationFailure) {
|
if (failure is GetOIDCConfigurationFailure) {
|
||||||
|
|||||||
Reference in New Issue
Block a user