Skip to content
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

Unable to login using AWS, #3594

Closed
SESA762550 opened this issue Apr 4, 2024 · 5 comments
Closed

Unable to login using AWS, #3594

SESA762550 opened this issue Apr 4, 2024 · 5 comments
Labels
auth Issues related to the Auth category bug Something isn't working

Comments

@SESA762550
Copy link

SESA762550 commented Apr 4, 2024

Describe the bug

I am facing below error while trying to logging in, this is working for most of the people but couple of members in the team are facing this issue from last 1 week. I have tried several times and tried almost everything but still no luck

Amplify: async syncProjectsV2 unknown error APIError: Failed to retrieve authorization token.
Caused by:
AuthError: There is no user signed in to retreive cognito tokens
Recovery suggestion: Call Auth.signIn to sign in a user and then call Auth.fetchSession
	Sync.V2. final SYNC request. Error: unknown(mySchneiderData.AmplError.unknown(APIError: Failed to retrieve authorization token.
AWS Sync: favoriteProduct sync error = unknown(mySchneiderData.AmplError.unknown(APIError: Failed to retrieve authorization token.
Caused by:
AuthError: Unexpected error occurred with message: Could not fetch AWS Cognito credentials, but there was no error reported back from
AWSMobileClient.getAWSCredentials call.
Recovery suggestion: This should not happen. There is a possibility that there is a bug if this error persists. Please take a look at https://github.com/aws-amplify/amplify-ios/issues to see if there are any existing issues that match your scenario, and file an issue with the details of the bug if there isn't. Issue encountered at:
file: /Users/utkarshagarwal/Documents/SchneiderElectric/Pods/Amplify/Amplify/Categories/Auth/Error/AuthError.swift

Below is the configuration file

{
    "auth": {
        "plugins": {
            "awsCognitoAuthPlugin": {
                "IdentityManager": {
                    "Default": {}
                },
                "CredentialsProvider": {
                    "CognitoIdentity": {
                        "Default": {
                            "PoolId": "POOL-ID",
                            "Region": "REGION"
                        }
                    }
                },
                "CognitoUserPool": {
                    "Default": {
                        "PoolId": "POOL-ID",
                        "AppClientId": "APP-CLIENT-ID",
                        "Region": "REGION"
                    }
                },
                "Auth": {
                    "Default": {
                        "authenticationFlowType": "USER_SRP_AUTH"
                    }
                }
            }
        }
    },
    "api": {
          "plugins": {
              "awsAPIPlugin": {
                  "api": {
                      "endpointType": "REST",
                      "endpoint": "ENDPOINT",
                      "region": "REGION",
                      "authorizationType": "AMAZON_COGNITO_USER_POOLS"
                  }
              }
          }
      }
}

Below is the podfile.lock

PODS:
  - Alamofire (5.7.1)
  - AlamofireImage (4.2.0):
    - Alamofire (~> 5.4)
  - Amplify (1.30.8):
    - Amplify/Default (= 1.30.8)
  - Amplify/Default (1.30.8)
  - AmplifyPlugins/AWSAPIPlugin (1.30.8):
    - AppSyncRealTimeClient (~> 3.1)
    - AWSCore (~> 2.34.0)
    - AWSPluginsCore (= 1.30.8)
  - AmplifyPlugins/AWSCognitoAuthPlugin (1.30.8):
    - AWSAuthCore (~> 2.34.0)
    - AWSCognitoIdentityProvider (~> 2.34.0)
    - AWSCognitoIdentityProviderASF (~> 2.34.0)
    - AWSCore (~> 2.34.0)
    - AWSMobileClient (~> 2.34.0)
    - AWSPluginsCore (= 1.30.8)
  - Apollo (0.39.0):
    - Apollo/Core (= 0.39.0)
  - Apollo/Core (0.39.0)
  - AppAuth (1.6.2):
    - AppAuth/Core (= 1.6.2)
    - AppAuth/ExternalUserAgent (= 1.6.2)
  - AppAuth/Core (1.6.2)
  - AppAuth/ExternalUserAgent (1.6.2):
    - AppAuth/Core
  - Applanga (2.0.161)
  - AppsFlyerFramework (6.4.4):
    - AppsFlyerFramework/Main (= 6.4.4)
  - AppsFlyerFramework/Main (6.4.4)
  - AppSyncRealTimeClient (3.1.2):
    - Starscream (= 4.0.4)
  - AWSAuthCore (2.34.2):
    - AWSCore (= 2.34.2)
  - AWSCognitoIdentityProvider (2.34.2):
    - AWSCognitoIdentityProviderASF (= 2.34.2)
    - AWSCore (= 2.34.2)
  - AWSCognitoIdentityProviderASF (2.34.2):
    - AWSCore (= 2.34.2)
  - AWSCore (2.34.2)
  - AWSMobileClient (2.34.2):
    - AWSAuthCore (= 2.34.2)
    - AWSCognitoIdentityProvider (= 2.34.2)
    - AWSCognitoIdentityProviderASF (= 2.34.2)
    - AWSCore (= 2.34.2)
  - AWSPluginsCore (1.30.8):
    - Amplify (= 1.30.8)
    - AWSCore (~> 2.34.0)

As described in #2527 this should be fixed with AWS SDK 2.28.2 but i am using 2.34.2 and still faing the issue.

I have tried deleting the application, Erasing content of Simulator, using fresh simulator , registering new users, removing all proxies and Firewall from my macbook but still facing the issue.

However few other folks from my team are able to login using same credentials.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Login Page'
  2. Click on 'Login Button'
  3. Enter the credentials
  4. Not able to Login

Expected behavior

It should succesfully be able to login

Amplify Framework Version

1.30.8

Amplify Categories

API, Auth

Dependency manager

Cocoapods

Swift version

5.0

CLI version

NA

Xcode version

14.3

Relevant log output

Amplify: async syncProjectsV2 unknown error APIError: Failed to retrieve authorization token.
Caused by:
AuthError: There is no user signed in to retreive cognito tokens
Recovery suggestion: Call Auth.signIn to sign in a user and then call Auth.fetchSession
	Sync.V2. final SYNC request. Error: unknown(mySchneiderData.AmplError.unknown(APIError: Failed to retrieve authorization token.

AWS Sync: favoriteProduct sync error = unknown(mySchneiderData.AmplError.unknown(APIError: Failed to retrieve authorization token.
Caused by:
AuthError: Unexpected error occurred with message: Could not fetch AWS Cognito credentials, but there was no error reported back from
AWSMobileClient.getAWSCredentials call.
Recovery suggestion: This should not happen. There is a possibility that there is a bug if this error persists. Please take a look at https://github.com/aws-amplify/amplify-ios/issues to see if there are any existing issues that match your scenario, and file an issue with the details of the bug if there isn't. Issue encountered at:
file: /Users/utkarshagarwal/Documents/SchneiderElectric/Pods/Amplify/Amplify/Categories/Auth/Error/AuthError.swift

Is this a regression?

Yes

Regression additional context

No response

Platforms

iOS

OS Version

16.4

Device

iPhone 14

Specific to simulators

No response

Additional context

No response

@ruisebas
Copy link
Member

ruisebas commented Apr 4, 2024

Hi @SESA762550, thanks for opening this issue.

We will take a look and come back to you.

@ruisebas ruisebas added bug Something isn't working auth Issues related to the Auth category labels Apr 4, 2024
@ruisebas
Copy link
Member

ruisebas commented Apr 8, 2024

Hi @SESA762550, looking at the error it seems like a similar but different issue than the one you linked.
So could you please provide the following information?

  • Exactly what Auth APIs are you invoking? Your reproduction steps mention a "Login page" and "Login button", but I assume those are on within your app. If you could provide code samples, that'd be helpful as well.
  • Verbose logs up until the error. You can enable verbose logging by adding Amplify.Logging.logLevel = .verbose before calling Amplify.configure()
  • Did you configure your backend using Amplify CLI? If so, which version?

Thanks!

@ruisebas ruisebas added the pending-community-response Issue is pending response from the issue requestor label Apr 8, 2024
@ruisebas
Copy link
Member

ruisebas commented May 6, 2024

Closing due to inactivity.

@ruisebas ruisebas closed this as completed May 6, 2024
@github-actions github-actions bot removed the pending-community-response Issue is pending response from the issue requestor label May 6, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@ruisebas ruisebas closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues related to the Auth category bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants