-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting logged out of Amplify when providing Credentials to SNSClient and restarting application #3225
Comments
Thanks for opening this @brianmwadime. You mentioned that you are using the aws-sdk-swift.
But from the code examples, it appears that you're using AWS SDK iOS. Can you confirm which one your using please? Thanks! |
@atierian sorry for the mixup, |
Thanks for the update. Can you please enable verbose logging for Amplify and AWS SDK iOS, then post the logs after reproducing the issue. That will help us investigate this. Amplify Swift Amplify.Logging.logLevel = .verbose AWS SDK iOS // swift
AWSDDLog.sharedInstance.logLevel = .verbose
// objc
[AWSDDLog sharedInstance].logLevel = AWSDDLogLevelVerbose; |
@atierian after loging in via amplify and setting up the credentials for the AWSSNS client from AWS SDK iOS. I am able to use it to publish a message successfully. Then I rebuild and deploy from XCode and this is what's logged as all the amplify request fail with a message requesting the user to be signed in again.
|
The amplify requests then return
|
From the logs I can see that you were never signed in. I see that you have a valid AuthZ session. I see that you are trying to retrieve the Cognito Session from a Would you be able to share verbose logging for both scenarios that you are trying. It could help me understand what happened before and after. |
Describe the bug
We are attempting to use the SNSClient in the
aws-sdk-swift
to work with SNS in our app.We provide a configuration for an authenticated user's credentials via custom
AWSCognitoCredentialsProviderHelper
andAWSIdentityProviderManager
->AWSCognitoCredentialsProvider
->AWSServiceConfiguration
then creating the client viaAWSSNS.register(with: configuration!, forKey: "USEast2SNS")
But whenever the client is used it seems to clear or invalidate the Amplify logged in user with the message that we the user has to sign in again.
How can we not break the amplify credentials refreshing mechanism while still using the underlying
aws-sdk-swift
with authenticated credentials fromAmplify.Auth.fetchAuthSession()
Steps To Reproduce
Provide a configuration for an authenticated user's credentials via custom
AWSCognitoCredentialsProviderHelper
orAWSIdentityProviderManager
->AWSCognitoCredentialsProvider
->AWSServiceConfiguration
then creating the client viaAWSSNS.register(with: configuration!, forKey: "USEast2SNS")
.We are using the
Amplify.Auth.fetchAuthSession()
to provide the credentials for the custom identity provider. See belowExpected behavior
A user's credentials should refresh upon expiry and the user should remain logged in.
Amplify Framework Version
2.16.0
Amplify Categories
API, Auth
Dependency manager
Swift PM
Swift version
5.8.1
CLI version
12.1.1
Xcode version
14.3.1 (14E300c)
Relevant log output
Is this a regression?
No
Regression additional context
No response
Platforms
iOS
OS Version
iOS 16
Device
iPhone 8
Specific to simulators
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: