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

Existing authentication resource setup userPoolId and userPoolWebClientId no longer optional #9845

Closed
3 tasks done
imraymondlee opened this issue Apr 27, 2022 · 2 comments
Closed
3 tasks done
Assignees
Labels
API Related to REST API issues Auth Related to Auth components/category bug Something isn't working duplicate If marked with duplicate, issue will be closed & original will be added for traceability

Comments

@imraymondlee
Copy link

imraymondlee commented Apr 27, 2022

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

Authentication, Geo

Amplify Categories

auth, geo

Environment information

  System:
    OS: macOS 11.6.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 53.79 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/opt/node@16/bin/node
    npm: 8.5.0 - /usr/local/opt/node@16/bin/npm
  Browsers:
    Chrome: 100.0.4896.127
    Firefox: 91.8.0
    Safari: 15.4
    Safari Technology Preview: 15.4
  npmPackages:
    @aws-amplify/ui-react: ^2.15.6 => 2.15.6 
    @aws-amplify/ui-react-internal:  undefined ()
    @aws-amplify/ui-react-legacy:  undefined ()
    @testing-library/jest-dom: ^5.16.4 => 5.16.4 
    @testing-library/react: ^13.1.1 => 13.1.1 
    @testing-library/user-event: ^13.5.0 => 13.5.0 
    react: ^18.0.0 => 18.0.0 (17.0.2)
    react-dom: ^18.0.0 => 18.0.0 
    react-scripts: 5.0.1 => 5.0.1 
    web-vitals: ^2.1.4 => 2.1.4 
  npmGlobalPackages:
    @amzn/harmony-cli: 1.7.63
    @aws-amplify/cli: 8.0.2
    corepack: 0.10.0
    npm: 8.5.0
    serve: 13.0.2

Describe the bug

We are manually configuring our resource following these instructions using Amplify UI Geo components (that uses Amplify Auth). We are not using the optional userPoolId and userPoolWebClientId properties as we are only using unauthenticated identities. Upon loading the page, we come across the following error:

[ERROR] 09:50.230 AuthError - 
            Error: Amplify has not been configured correctly. 
            The configuration object is missing required auth properties.
            This error is typically caused by one of the following scenarios:

            1. Did you run `amplify push` after adding auth via `amplify add auth`?
                See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information

            2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages.

We do not get this error when we have values for userPoolId and userPoolWebClientId.

Expected behavior

We should not be getting this error when we don't have userPoolId and userPoolWebClientId set.

Reproduction steps

  1. Manually set up Amazon Location Service map resource and Amazon Cognito following https://docs.amplify.aws/lib/geo/existing-resources/q/platform/js/
  2. Set up a map following https://ui.docs.amplify.aws/components/geo but pass in parameter for Amplify.configure() from step 1.
  3. Start the application and the DevTools console will display the error.

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

{
  Auth: {
    identityPoolId: "XX-XXXX-X:XXXXXXXX-XXXX-1234-abcd-1234567890ab",
    region: "XX-XXXX-X,
  },
  geo: {
    AmazonLocationService: {
      maps: {
        items: {
          "EsriLight": {
            style: "VectorEsriTopographic",
          },
        },
        default: "EsriLight",
      },
      region: "XX-XXXX-X",
    },
  },
})

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

We were not seeing this issue in aws-amplify@4.3.12. Upon investigation, I saw that there was a change here that now displays an error. currentSession() eventually gets called when Amplify UI Geo calls currentUserCredentials().

@vyomr13
Copy link

vyomr13 commented Apr 27, 2022

Hello @imraymondlee 👋
Thanks for opening this issue. This is a known issue and worked on here as part of this so I am marking this as a duplicate.

@vyomr13 vyomr13 added duplicate If marked with duplicate, issue will be closed & original will be added for traceability bug Something isn't working Auth Related to Auth components/category API Related to REST API issues labels Apr 27, 2022
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server amplify-help forum.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Related to REST API issues Auth Related to Auth components/category bug Something isn't working duplicate If marked with duplicate, issue will be closed & original will be added for traceability
Projects
None yet
Development

No branches or pull requests

3 participants