aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.45k stars 2.13k forks source link

invalid_client error returned while trying to sign in with web UI #12875

Closed kxu12348760 closed 10 months ago

kxu12348760 commented 10 months ago

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Authentication

Amplify Version

v6

Amplify Categories

auth

Backend

Other

Environment information

``` System: OS: macOS 13.6.3 CPU: (10) arm64 Apple M1 Max Memory: 3.52 GB / 32.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 18.6.0 - ~/Work/mdcollab/frontend/deps/node/v18.6.0-v1.22.5-darwin-arm64/bin/node Yarn: 3.2.1 - ~/Work/mdcollab/frontend/deps/node/v18.6.0-v1.22.5-darwin-arm64/bin/yarn npm: 8.13.2 - ~/Work/mdcollab/frontend/deps/node/v18.6.0-v1.22.5-darwin-arm64/bin/npm Watchman: 2023.12.04.00 - /opt/homebrew/bin/watchman Browsers: Chrome: 120.0.6099.234 Firefox: 121.0.1 Safari: 16.6 npmPackages: @aivenio/tsc-output-parser: ^2.1.1 => 2.1.1 @apollo/client: ^3.6.9 => 3.7.10 @apollo/client/cache: undefined () @apollo/client/core: undefined () @apollo/client/errors: undefined () @apollo/client/link/batch: undefined () @apollo/client/link/batch-http: undefined () @apollo/client/link/context: undefined () @apollo/client/link/core: undefined () @apollo/client/link/error: undefined () @apollo/client/link/http: undefined () @apollo/client/link/persisted-queries: undefined () @apollo/client/link/retry: undefined () @apollo/client/link/schema: undefined () @apollo/client/link/subscriptions: undefined () @apollo/client/link/utils: undefined () @apollo/client/link/ws: undefined () @apollo/client/react: undefined () @apollo/client/react/components: undefined () @apollo/client/react/context: undefined () @apollo/client/react/hoc: undefined () @apollo/client/react/hooks: undefined () @apollo/client/react/parser: undefined () @apollo/client/react/ssr: undefined () @apollo/client/testing: undefined () @apollo/client/testing/core: undefined () @apollo/client/utilities: undefined () @apollo/client/utilities/globals: undefined () @aws-amplify/react-native: 1.0.7 => 1.0.7 @aws-amplify/rtn-web-browser: 1.0.7 => 1.0.7 @babel/cli: 7.12.17 => 7.12.17 @babel/core: 7.12.9 => 7.12.9 (7.21.3) @babel/plugin-proposal-export-namespace-from: ^7.18.9 => 7.18.9 @babel/polyfill: 7.12.1 => 7.12.1 @babel/preset-typescript: 7.12.13 => 7.12.13 (7.21.0) @babel/register: 7.12.13 => 7.12.13 (7.21.0) @babel/runtime: 7.12.18 => 7.12.18 (7.21.0, 7.23.1) @braze/web-sdk-core: 3.3.0 => 3.3.0 @c10h/colors: 1.1.0 => 1.1.0 @c10h/typography: 1.3.0 => 1.3.0 @ch/codegen: workspace:* => 1.0.0 @ch/data: workspace:* => 1.0.0 @ch/react-native-devices-sdk: workspace:* => 1.0.0 @ch/ui: workspace:* => 1.0.0 @emotion/core: 10.0.10 => 10.0.10 (10.3.1) @graphql-codegen/cli: 2.16.2 => 2.16.2 @graphql-codegen/fragment-matcher: ^3.3.0 => 3.3.3 @graphql-codegen/introspection: ^2.2.0 => 2.2.3 @graphql-codegen/near-operation-file-preset: 2.4.0 => 2.4.0 @graphql-codegen/typescript: 2.7.2 => 2.7.2 (2.8.8) @graphql-codegen/typescript-operations: 2.5.2 => 2.5.2 @graphql-codegen/typescript-react-apollo: 3.3.2 => 3.3.2 @graphql-eslint/eslint-plugin: 3.10.6 => 3.10.6 @notifee/react-native: 7.4.0 => 7.4.0 @okta/okta-auth-js: ^6.7.1 => 6.9.0 (5.4.1) @okta/okta-react-native: 2.6.0 => 2.6.0 @pmmmwh/react-refresh-webpack-plugin: ^0.5.7 => 0.5.10 (0.4.3) @react-native-async-storage/async-storage: 1.15.15 => 1.15.15 @react-native-clipboard/clipboard: 1.7.0 => 1.7.0 @react-native-community/art: 1.0.1 => 1.0.1 @react-native-community/blur: 3.6.0 => 3.6.0 @react-native-community/cli: 6.4.0 => 6.4.0 (9.3.2) @react-native-community/cli-platform-ios: 6.2.1 => 6.2.1 (9.3.0) @react-native-community/cli-server-api: ^8.0.0 => 8.0.4 (6.4.3, 9.2.1) @react-native-community/datetimepicker: 3.5.2 => 3.5.2 @react-native-community/eslint-config: ^2.0.0 => 2.0.0 @react-native-community/geolocation: 2.0.2 => 2.0.2 @react-native-community/push-notification-ios: 1.0.2 => 1.0.2 @react-native-community/slider: 4.1.12 => 4.1.12 @react-native-firebase/app: 16.7.0 => 16.7.0 @react-native-firebase/dynamic-links: 16.7.0 => 16.7.0 @react-native-firebase/messaging: 16.7.0 => 16.7.0 @react-native-picker/picker: 2.4.8 => 2.4.8 @reduxjs/toolkit: 1.8.1 => 1.8.1 @reduxjs/toolkit-query: 1.0.0 @reduxjs/toolkit-query-react: 1.0.0 @sentry/node: ^7.61.0 => 7.61.0 @sentry/react: 7.36.0 => 7.36.0 (7.32.1) @sentry/react-native: 4.14.0 => 4.14.0 @sentry/tracing: 7.10.0 => 7.10.0 (7.32.1) @sentry/webpack-plugin: ^1.20.0 => 1.20.0 @shopify/flash-list: 1.4.2 => 1.4.2 @size-limit/preset-app: ^7.0.8 => 7.0.8 @storybook/addon-actions: 6.2.9 => 6.2.9 @storybook/addon-backgrounds: 6.4.22 => 6.4.22 @storybook/addon-knobs: 6.2.9 => 6.2.9 @storybook/addon-links: 6.2.9 => 6.2.9 @storybook/addon-toolbars: 6.4.22 => 6.4.22 @storybook/addon-viewport: 6.2.9 => 6.2.9 @storybook/addons: 6.2.9 => 6.2.9 (6.4.22, 5.3.21, 6.5.16) @storybook/builder-webpack5: 6.2.9 => 6.2.9 @storybook/react: 6.2.9 => 6.2.9 @storybook/react-native: 5.3.23 => 5.3.23 @stripe/react-stripe-js: 1.16.4 => 1.16.4 @stripe/stripe-js: 1.46.0 => 1.46.0 @stripe/stripe-react-native: 0.26.0 => 0.26.0 @testing-library/jest-native: 4.0.1 => 4.0.1 @testing-library/react-native: 11.2.0 => 11.2.0 @types/capitalize: 1.0.1 => 1.0.1 @types/color: 3.0.1 => 3.0.1 @types/command-line-args: 4.0.3 => 4.0.3 @types/cors: 2.8.5 => 2.8.5 @types/d3-array: 3.0.1 => 3.0.1 @types/deep-assign: 0.1.1 => 0.1.1 @types/enzyme: 3.10.3 => 3.10.3 (3.10.12) @types/enzyme-adapter-react-16: 1.0.5 => 1.0.5 @types/express: 4.16.1 => 4.16.1 (4.17.17) @types/fetch-mock: 7.3.2 => 7.3.2 @types/google-libphonenumber: 7.4.17 => 7.4.17 @types/googlemaps: 3.30.12 => 3.30.12 @types/hoist-non-react-statics: 3.3.1 => 3.3.1 @types/jest: 24.0.18 => 24.0.18 @types/lodash: 4.14.129 => 4.14.129 @types/markerclustererplus: 2.1.33 => 2.1.33 @types/memoizee: 0.4.2 => 0.4.2 @types/moment-timezone: 0.5.30 => 0.5.30 @types/morgan: 1.7.35 => 1.7.35 @types/node: 18.x.x => 18.15.5 (14.18.63, 12.20.55) @types/node-fetch: 2.1.7 => 2.1.7 (2.6.2) @types/papaparse: 5.0.3 => 5.0.3 @types/puppeteer: 1.5.1 => 1.5.1 @types/qs: 6.4.0 => 6.4.0 (6.9.7) @types/react: 18.0.24 => 17.0.44 @types/react-datepicker: 1.8.0 => 1.8.0 @types/react-dom: 18.0.8 => 18.0.8 @types/react-native: 0.70.6 => 0.70.6 (0.71.4) @types/react-native-calendars: 1.20.6 => 1.20.6 @types/react-native-fs: 2.8.3 => 2.8.3 @types/react-native-keep-awake: 2.0.2 => 2.0.2 @types/react-native-keyboard-spacer: 0.4.1 => 0.4.1 @types/react-native-orientation: 5.0.1 => 5.0.1 @types/react-native-share: 1.1.1 => 1.1.1 @types/react-native-signature-capture: 0.4.0 => 0.4.0 @types/react-native-snap-carousel: 3.7.2 => 3.7.2 @types/react-native-tab-view: 1.0.6 => 1.0.6 @types/react-native-touch-id: 4.0.1 => 4.0.1 @types/react-native-vector-icons: 4.6.4 => 4.6.4 @types/react-native-video: 5.0.14 => 5.0.14 @types/react-redux: 7.1.23 => 7.1.23 (7.1.25) @types/react-table: 7.7.2 => 7.7.2 @types/react-test-renderer: 18.0.7 => 18.0.7 @types/react-webcam: 1.1.0 => 1.1.0 @types/redux: 3.6.0 => 3.6.0 @types/redux-form: 7.4.16 => 7.4.16 @types/redux-logger: 3.0.7 => 3.0.7 @types/redux-mock-store: 1.0.1 => 1.0.1 @types/request: 2.48.1 => 2.48.1 (2.48.8) @types/request-promise-native: 1.0.16 => 1.0.16 @types/urijs: 1.19.1 => 1.19.1 @types/uuid: 2.0.30 => 2.0.30 (9.0.7) @types/validator: 5.7.35 => 5.7.35 @types/victory: 31.0.19 => 31.0.19 @typescript-eslint/eslint-plugin: 5.4.0 => 5.4.0 (3.10.1) @typescript-eslint/parser: 5.4.0 => 5.4.0 (3.10.1) @welldone-software/why-did-you-render: 6.2.3 => 6.2.3 HelloWorld: 0.0.1 PDFExample: 0.0.1 SignatureCaptureExample: 0.0.1 autoprefixer: ^10.4.16 => 10.4.16 (9.8.8) aws-amplify: 6.0.7 => 6.0.7 aws-amplify/adapter-core: undefined () aws-amplify/analytics: undefined () aws-amplify/analytics/kinesis: undefined () aws-amplify/analytics/kinesis-firehose: undefined () aws-amplify/analytics/personalize: undefined () aws-amplify/analytics/pinpoint: undefined () aws-amplify/api: undefined () aws-amplify/api/server: undefined () aws-amplify/auth: undefined () aws-amplify/auth/cognito: undefined () aws-amplify/auth/cognito/server: undefined () aws-amplify/auth/server: undefined () aws-amplify/datastore: undefined () aws-amplify/in-app-messaging: undefined () aws-amplify/in-app-messaging/pinpoint: undefined () aws-amplify/push-notifications: undefined () aws-amplify/push-notifications/pinpoint: undefined () aws-amplify/storage: undefined () aws-amplify/storage/s3: undefined () aws-amplify/storage/s3/server: undefined () aws-amplify/storage/server: undefined () aws-amplify/utils: undefined () aws-sdk: 2.832.0 => 2.832.0 babel-eslint: 10.0.1 => 10.0.1 (10.1.0) babel-jest: 24.9.0 => 24.9.0 (25.5.1) babel-loader: 8.0.4 => 8.0.4 (8.3.0) babel-plugin-transform-remove-console: 6.9.4 => 6.9.4 base-64: 1.0.0 => 1.0.0 (0.1.0) benchmark-uuid: undefined () branch-sdk: 2.31.0 => 2.31.0 capitalize: 1.0.0 => 1.0.0 command-line-args: 4.0.6 => 4.0.6 (3.0.5) copy-webpack-plugin: 5.1.1 => 5.1.1 cors: 2.8.4 => 2.8.4 csp-html-webpack-plugin: 5.1.0 => 5.1.0 css-loader: 3.6.0 => 3.6.0 (5.2.7) d3-array: 2.3.3 => 2.3.3 (1.2.4) deep-assign: 3.0.0 => 3.0.0 deprecated-react-native-prop-types: 5.0.0 => 5.0.0 (2.3.0) detox: 17.6.1 => 17.6.1 dotenv: 8.0.0 => 8.0.0 (16.0.3, 8.6.0, 6.2.0) dotenv-webpack: 1.7.0 => 1.7.0 (1.8.0, 6.0.4) enzyme: 3.10.0 => 3.10.0 enzyme-adapter-react-16: 1.14.0 => 1.14.0 enzyme-react-16-adapter-setup: 0.1.0 => 0.1.0 enzyme-to-json: 3.4.0 => 3.4.0 (3.6.2) errio: 1.2.2 => 1.2.2 es6-promise: 4.2.4 => 4.2.4 esbuild-loader: ^2.20.0 => 2.21.0 eslint: 7.32.0 => 7.32.0 eslint-config-prettier: 7.2.0 => 7.2.0 (6.15.0) eslint-plugin-jsx-falsy: ^1.0.0 => 1.0.0 eslint-plugin-prettier: 4.0.0 => 4.0.0 (3.1.2) eslint-plugin-promise: 6.0.0 => 6.0.0 eslint-plugin-react: 7.27.1 => 7.27.1 (7.32.2) expo: 47.0.0 => 47.0.0 expo-constants: 14.0.2 => 14.0.2 (13.2.4) expo-dev-client: 2.0.1 => 2.0.1 expo-keep-awake: 12.0.1 => 12.0.1 (11.0.1) expo-screen-orientation: 5.0.1 => 5.0.1 expo-updates: 0.15.6 => 0.15.6 express: 4.15.3 => 4.15.3 (4.18.2) faker: 5.1.0 => 5.1.0 fast-deep-equal: 3.1.3 => 3.1.3 (2.0.1) fetch-mock: 8.3.1 => 8.3.1 file-loader: 1.1.11 => 1.1.11 (6.2.0) fuse.js: https://github.com/mdcollab/Fuse.git#da97974901cfaea1816381337cdb20ca03fa1050 => 3.2.1 (3.6.1) geolib: 3.3.3 => 3.3.3 google-libphonenumber: 3.0.5 => 3.0.5 graphql: 16.5.0 => 16.5.0 (15.8.0, 16.6.0) hermes-inspector-msggen: 1.0.0 highlight.js: ^11.8.0 => 11.8.0 (10.7.3) hoist-non-react-statics: 2.5.5 => 2.5.5 (3.3.2, 1.2.0) html-webpack-plugin: ^5.5.3 => 5.5.3 (4.5.2, 5.5.0) http-server: ^14.1.1 => 14.1.1 husky: 7.0.0 => 7.0.0 i18next: 19.3.0 => 19.3.0 (22.4.13) i18next-browser-languagedetector: 6.1.2 => 6.1.2 i18next-http-backend: 1.2.6 => 1.2.6 i18next-scanner: 3.0.0 => 3.0.0 i18next-scanner-typescript: 1.0.6 => 1.0.6 ignore-styles: 5.0.1 => 5.0.1 imports-loader: 0.8.0 => 0.8.0 inquirer: 7.3.3 => 7.3.3 (8.2.5, 6.5.2, 0.10.0) jest: 25.5.4 => 25.5.4 jest-circus: 25.5.4 => 25.5.4 jest-enzyme: 7.1.1 => 7.1.1 jest-github-actions-reporter: 1.0.3 => 1.0.3 jest-junit: 12.2.0 => 12.2.0 jetifier: 1.6.4 => 1.6.4 (1.6.8) jquery: 3.5.0 => 3.5.0 lint-staged: 11.0.0 => 11.0.0 locize-cli: 7.8.1 => 7.8.1 lodash: ^4.17.10 => 4.17.21 (4.17.4, 3.10.1) memoizee: 0.4.4 => 0.4.4 metro-react-native-babel-preset: 0.74.1 => 0.72.3 microsoft-cognitiveservices-speech-sdk: 1.32.0 => 1.32.0 mitt: 3.0.0 => 3.0.0 mockdate: 2.0.5 => 2.0.5 module-alias: 2.0.0 => 2.0.0 moment-timezone: 0.5.30 => 0.5.30 (0.5.41) morgan: 1.9.1 => 1.9.1 msw: 0.41.0 => 0.41.0 msw-storybook-addon: 1.6.3 => 1.6.3 native-base: 2.15.2 => 2.15.2 nativewind: ^2.0.11 => 2.0.11 node-abort-controller: ^3.1.1 => 3.1.1 node-fetch: 2.1.2 => 2.1.2 (2.6.9, 2.6.7, 2.6.1, 1.7.3) nodemon: 2.0.16 => 2.0.16 papaparse: 5.1.0 => 5.1.0 patch-package: 6.4.7 => 6.4.7 plist: ^3.0.6 => 3.0.6 postcss-loader: 4.2.0 => 4.2.0 (4.3.0) prettier: 2.0.5 => 2.0.5 (2.8.6) prop-types: ^15.6.0 => 15.8.1 puppeteer: 2.1.0 => 2.1.0 qrcode: ^1.5.1 => 1.5.1 qs: 6.4.0 => 6.4.0 (6.11.1, 6.11.0, 6.7.0, 5.2.1, 6.5.3, 6.9.7, 6.4.1) quill: ^1.3.7 => 1.3.7 react: 18.1.0 => 18.1.0 (17.0.2, 16.14.0) react-art: 16.8.3 => 16.8.3 react-datepicker: 1.4.1 => 1.4.1 react-devtools: 4.24.0 => 4.24.0 react-dom: 18.1.0 => 18.1.0 react-ga: 2.5.3 => 2.5.3 react-google-maps: 9.4.5 => 9.4.5 react-hook-form: 7.28.1 => 7.28.1 react-i18next: 11.11.0 => 11.11.0 react-native: 0.70.8 => 0.70.8 react-native-appboy-sdk: 1.32.0 => 1.32.0 react-native-audio-recorder-player: 3.5.3 => 3.5.3 react-native-bluetooth-status: ^1.5.1 => 1.5.1 react-native-branch: 4.2.1 => 4.2.1 react-native-calendars: 1.403.0 => 1.403.0 react-native-camera: 3.1.1 => 3.1.1 react-native-codegen: npm:0.0.7 => 0.0.7 (0.70.7) react-native-device-info: 10.11.0 => 10.11.0 react-native-document-picker: 3.2.4 => 3.2.4 react-native-flip-view: https://github.com/mdcollab/react-native-flip-view.git#ed7f252b2d8b21131258def49e23189b85853b93 => 1.0.5 react-native-fs: 2.14.1 => 2.14.1 react-native-gesture-handler: 2.10.0 => 2.10.0 react-native-get-random-values: ~1.8.0 => 1.8.0 react-native-google-places-autocomplete: 2.5.1 => 2.5.1 react-native-hyperlink: 0.0.11 => 0.0.11 react-native-image-picker: 2.2.1 => 2.2.1 react-native-image-resizer: ^1.4.5 => 1.4.5 react-native-keyboard-aware-scroll-view: ^0.9.5 => 0.9.5 react-native-keyboard-spacer: https://github.com/mdcollab/react-native-keyboard-spacer.git#cb286668e3791668c9cb38856464f3b2c9fbf27a => 0.3.0 react-native-linear-gradient: 2.6.2 => 2.6.2 react-native-live-audio-stream: ^1.1.1 => 1.1.1 react-native-localize: 2.1.7 => 2.1.7 react-native-maps: 1.8.0 => 1.8.0 react-native-monorepo-tools: ^1.2.0 => 1.2.1 react-native-paper: 4.12.5 => 4.12.5 react-native-pdf: 6.1.0 => 6.1.0 react-native-permissions: 3.6.1 => 3.6.1 react-native-print: 0.6.0 => 0.6.0 react-native-randombytes: 3.5.3 => 3.5.3 react-native-reanimated: 2.17.0 => 2.17.0 react-native-safe-area-context: 3.3.2 => 3.3.2 react-native-screens: 2.16.1 => 2.16.1 react-native-share: 8.2.1 => 8.2.1 react-native-signature-capture: https://github.com/RepairShopr/react-native-signature-capture.git#2346c39db1a5e3e8d5952ce36322cadc37825cdc => 0.4.9 react-native-snap-carousel: 3.7.0 => 3.7.0 react-native-splash-screen: 3.3.0 => 3.3.0 react-native-store-review: 0.1.5 => 0.1.5 react-native-svg: 12.3.0 => 12.3.0 react-native-tab-view: 2.16.0 => 2.16.0 (1.4.1) react-native-toast-notifications: 3.1.1 => 3.1.1 react-native-tooltip: 5.2.0 => 5.2.0 react-native-touch-id: https://github.com/mdcollab/react-native-touch-id.git#1cc7f5ab8e115806979d98ad0f8ef515d35d87a6 => 4.4.1 react-native-ui-lib: ^7.11.3 => 7.11.3 react-native-vector-icons: 6.6.0 => 6.6.0 react-native-video: 5.2.1 => 5.2.1 react-native-web: 0.18.12 => 0.18.12 react-native-web-image-loader: 0.0.5 => 0.0.5 react-native-webview: 11.26.0 => 11.26.0 react-navigation: 4.1.1 => 4.1.1 react-navigation-drawer: 1.4.0 => 1.4.0 react-navigation-stack: 1.10.3 => 1.10.3 react-navigation-tabs: 2.3.0 => 2.3.0 react-qr-reader: 2.2.1 => 2.2.1 react-quill: 1.2.7 => 1.2.7 react-redux: 7.2.8 => 7.2.8 react-refresh: ^0.14.0 => 0.14.0 (0.8.3, 0.4.3) react-string-replace: 0.4.4 => 0.4.4 react-table: ^7.7.0 => 7.8.0 react-table-6: 6.11.0 => 6.11.0 react-table-hoc-fixed-columns: 2.3.3 => 2.3.3 react-test-renderer: 18.2.0 => 18.2.0 (16.14.0) react-tooltip-lite: 1.12.0 => 1.12.0 react-webcam: 1.0.4 => 1.0.4 redux: 4.2.0 => 4.2.0 (4.2.1, 3.7.2) redux-devtools-extension: 2.13.5 => 2.13.5 redux-form: 8.3.8 => 8.3.8 redux-logger: 3.0.6 => 3.0.6 redux-mock-store: 1.5.4 => 1.5.4 redux-persist: 6.0.0 => 6.0.0 redux-persist/integration/react: undefined () redux-thunk: 2.3.0 => 2.3.0 (2.4.2) reflective-bind: 0.2.3 => 0.2.3 rehype-parse: ^8.0.4 => 8.0.4 rehype-remark: ^9.1.2 => 9.1.2 remark: ^14.0.3 => 14.0.3 remark-html: ^15.0.2 => 15.0.2 remark-stringify: ^10.0.3 => 10.0.3 replace-in-file: ^6.3.5 => 6.3.5 request: 2.81.0 => 2.81.0 (2.67.0, 2.88.2) request-promise-native: 1.0.4 => 1.0.4 (1.0.9) reselect: 3.0.1 => 3.0.1 (4.1.7) rn-fetch-blob: 0.10.16 => 0.10.16 script-ext-html-webpack-plugin: 2.1.5 => 2.1.5 semver: ^7.5.0 => 7.5.0 (6.3.0, 5.7.1, 6.3.1, 7.3.8, 7.3.2, 7.3.5, 5.4.1, 2.3.2, 5.7.2) signature_pad: 2.3.2 => 2.3.2 size-limit: ^7.0.8 => 7.0.8 storybook-addon-mock: 2.1.0 => 2.1.0 storybook-addon-pseudo-states: 1.14.0 => 1.14.0 style-loader: 0.20.1 => 0.20.1 (1.3.0, 2.0.0) svgs: 4.1.0 => 4.1.0 tailwindcss: ^3.2.7 => 3.2.7 ts-jest: 24.0.2 => 24.0.2 ts-node: ^10.9.1 => 10.9.1 typescript: 4.6.3 => 4.6.3 (3.9.10) ua-parser-js: 0.7.21 => 0.7.21 (0.7.34) uilib-native: 4.1.1 urijs: 1.19.10 => 1.19.10 url-loader: 1.1.0 => 1.1.0 (4.1.1) uuid: 2.0.3 => 2.0.3 (8.3.2, 9.0.0, 3.4.0, 3.3.2, 3.1.0, 7.0.3) uuid-random: 1.3.2 => 1.3.2 uuid-random-benchmark: 1.0.0 validator: 5.7.0 => 5.7.0 victory: 0.26.0 => 0.26.0 victory-native: 30.0.0 => 30.0.0 webpack: v5.88.2 => 5.88.2 (4.46.0) webpack-bundle-analyzer: 4.5.0 => 4.5.0 webpack-cli: 3.3.12 => 3.3.12 webpack-dev-server: 3.9.0 => 3.9.0 webpack-merge: 4.1.4 => 4.1.4 whatwg-fetch: 2.0.4 => 2.0.4 (3.6.2) world-countries: 1.8.1 => v1.8.1 yargs-parser: ^21.1.1 => 21.1.1 (20.2.9, 13.1.2, 10.1.0, 11.1.1, 15.0.3, 18.1.3) npmGlobalPackages: corepack: 0.12.0 npm: 8.13.2 yarn: 1.22.5 ```

Describe the bug

We are attempting to add cognito auth integration through aws-amplify in our web application. This is for our dev/staging/non-production environment.

After finishing setting up our backend resources and configuring our frontend to connect to those existing resources, our frontend code calls signInWithRedirect while passing in our custom (okta-based) provider.

However, after successfully signing in through our okta custom oidc provider, after redirecting back to our app, we cannot continue because it seems that we get an invalid_client response from the oauth2/token endpoint, which seems very similar to this previous issue.

Expected behavior

Expected:

Actual:

Reproduction steps

  1. Go to our login page (in my case, it's localhost:3001) and click login (which calls signInWithRedirect({provider: {custom: <my_custom_oidc_provider_name>}})). Note that in the first screenshot below, I've included console logs which partially show the parameters passed to Amplify.configure in our app), which I've double-checked and should be correct.
Screenshot 2024-01-22 at 3 49 59 PM
  1. Get redirected to the custom OIDC IDP login page, which in this case is an okta login screen:
Screenshot 2024-01-22 at 3 50 29 PM
  1. Okta login works (credentials are correct), and I'm prompted to push a 2fa verification request to my okta app on my phone.
Screenshot 2024-01-22 at 3 50 52 PM
  1. After correctly verifying okta on my phone, I get redirected to the same login page again, but there's an unsuccessful oauth2/token 400 request which returns invalid_client.
Screenshot 2024-01-22 at 3 51 37 PM
  1. Looking at the failed oauth2/token request (which I'm guessing is generated by the amplify js library), it's passing in the following parameters and headers:
Screenshot 2024-01-22 at 3 52 33 PM Screenshot 2024-01-22 at 3 53 05 PM

Code Snippet

// On app load, we call Amplify.configure like the following:
Amplify.configure({
        Auth: {
          Cognito: {
            userPoolId: <someUserPoolIdVal>,
            userPoolClientId: <someUserPoolClientVal>,
            signUpVerificationMethod: "code",
            loginWith: {
              oauth: {
                domain: <myCognitoDomain>,
                scopes: <array_of_cognito_scopes>,
                redirectSignIn: "localhost:3001",
                redirectSignOut: "localhost:3001",
                responseType: "code",
              },
            },
          },
        },
      })
...
...
...
// when login button is clicked, the following gets executed:
 signInWithRedirect({provider: {custom: <myCustomOIDCProviderName>}})

Log output

``` // Put your logs below this line ```

aws-exports.js

No response

Manual configuration

No response

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

No response

nadetastic commented 10 months ago

Hi @kxu12348760 thank you for opening this issue, im currently investigating this and wanted to check some thing with you first. It seems that the step of checking 2fa verification request maybe the root of the issue here - to help in isolating, have you been able to test a login without the 2fa check and get a successful login?

kxu12348760 commented 10 months ago

hi @nadetastic thanks for your reply. We ended up resolving this issue. It turns out that we were able to successfully obtain a token while connecting to clients as long as our client didn't have a client secret set, whereas originally, the client we couldn't connect to had a client secret set.

nadetastic commented 10 months ago

@kxu12348760 okay great! Glad you were able to get this resolved. Let me know if you have any other questions, otherwise I will go ahead and close out this issue.