diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin+Configure.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin+Configure.swift index 721880d462..fdcfbf9385 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin+Configure.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin+Configure.swift @@ -7,7 +7,6 @@ import Foundation @_spi(InternalAmplifyConfiguration) import Amplify - import AWSCognitoIdentity import AWSCognitoIdentityProvider import AWSPluginsCore @@ -112,6 +111,9 @@ extension AWSCognitoAuthPlugin { configuration.retryStrategyOptions = RetryStrategyOptions(maxRetriesBase: Int(maxRetryUnwrapped)) } + let authService = AWSAuthService() + configuration.credentialsProvider = authService.getCredentialsProvider() + return CognitoIdentityProviderClient(config: configuration) default: fatalError() @@ -134,6 +136,9 @@ extension AWSCognitoAuthPlugin { configuration.retryStrategyOptions = RetryStrategyOptions(maxRetriesBase: Int(maxRetryUnwrapped)) } + let authService = AWSAuthService() + configuration.credentialsProvider = authService.getCredentialsProvider() + return CognitoIdentityClient(config: configuration) default: fatalError()