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.43k stars 2.13k forks source link

Amplify signout doesn't signout from custom provider/idp/okta #12991

Closed kxu12348760 closed 9 months ago

kxu12348760 commented 9 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

Note: the problems described below sound very similar to what's described in these two stack overflow posts (here and here)

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

We're able to successfully login to our application through via a custom okta idp login (via cognito) by calling signInWithRedirect. This cognito login flow:

  1. redirects the user to an okta login page
  2. After successfully logging in with okta credentials, we get redirected back to our login page
  3. Our login page picks up on a successful siginWithRedirect message via the hub, and we're able to successfully fetch a cognito access token via fetchAuthSession
  4. We're able to successfully use the token from 3) to log in to our application, which can accept such cognito tokens.

However, when we invoke our application signout flow, which ends up calling signout, what happens is the following:

I find that if I clear my browser cache + cookies, things go back to working as expected, e.g.

  1. I don't get automatically re-logged back in to the previous user that I just logged out of, but rather
  2. I get redirected back to an okta login screen where I have to manually re-type in my credentials.

Expected behavior

When we call signout in our application,

  1. I try to log back in to our application by clicking our login button.
  2. Instead of getting automatically logged back in, I get redirected to an okta idp login page where I have to re-enter my okta credentials to successfully log in through cognito.

Reproduction steps

1. initial login

Screenshot 2024-02-08 at 4 35 46 PM

2. redirect to okta idp (via cognito amplify)

Screenshot 2024-02-08 at 4 34 38 PM

3. successful login, will click logout

Screenshot 2024-02-08 at 4 36 05 PM

4. successful logout, redirect back to login page (this shows that signout kind of works, because if it didn't, any redirect to login page will attempt to check for an existing cognito session via our amplify configuration and automatically log in if there's one)

Screenshot 2024-02-08 at 4 35 37 PM

5. however, re-attempting to login as ke@carbonhealth.com doesn't redirect to okta, we get automatically signed in after clicking log-in:

Screenshot 2024-02-08 at 4 34 25 PM Screenshot 2024-02-08 at 4 35 26 PM
  1. Furthermore, signing out and trying to log in as another user (greg+beta@carbonhealth.com) directly through okta (this is for our users not enabled through aws cognito), causes an automatic login as ke@carbonhealth.com
Screenshot 2024-02-08 at 4 36 20 PM Screenshot 2024-02-08 at 4 36 05 PM (1)

7. It seems that if I clear all cookies/cache in my browser, i am able to get back to my desired behavior of getting redirected to the okta login screen by cognito.

Screenshot 2024-02-08 at 4 34 38 PM

Code Snippet

// when our app loads
import {Amplify} from "aws-amplify";
...
...
const cognitoConfig = getCognitoConfig(); // This fetches us the right cognito config, which we confirm works.
Amplify.configure(cognitoConfig);

// in our login page react native component
...
import {Hub} from "aws-amplify/utils";
import {fetchAuthSession, signInWithRedirect} from "aws-amplify/auth";
...
...
componentDidMount() {
  Hub.listen("auth", ({payload}) => {
      switch (payload.event) {
        case "signInWithRedirect":
          ....
          ...
          return fetchAuthSession()
               .then(authSession => saveAuthSessionToLocalCache(authSession))   // our own function/logic which we confirm works as expected
               .then(() => loginToApp());    // our own function/logic which we confirmed works as expected
      }
    });
}
...
...
// when login button is clicked
const customIdpProvider = await getCustomIdpProvider(email); // our own function which maps an email to a custom idp provider
signInWithRedirect({provider: {custom: customIdpProvider}}); // customIdpProvider is something like 'myOrgOkta' in this case
...
...

// During app logout
...
...
import {signOut} from "aws-amplify/auth";
...
...
clearAuthSessionLocalCacheData(); // our own function/logic which we confirm works as expected
...
...
await signOut();
...

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

hanoj-budime commented 9 months ago

The same happens to me. When a user clicks 'Sign Out' in our application, it signs out the current user without any issue and clears local storage. However, after signing out, when I attempt to sign back in by clicking our login button with the LinkedIn OIDC flow, instead of asking for the LinkedIn username and password, it is using Cognito Hosted UI cookies to generate jwt token of idp user. This should prompt for user credentials to sign-in with LinkedIn.

thiagobucca commented 9 months ago

I'm also having the same issue using a custom provider on a ReactJS app. I'm wondering if when going federated the SignOut flow is different...

version 6.0.15

hanoj-budime commented 9 months ago

@cwomack, include tags react js and js as well.

Basically, Bug in your cognito hosted UI IDP sign-in flows. clearing cookies while user is signing-out.

nadetastic commented 9 months ago

Related https://github.com/aws-amplify/amplify-js/issues/4044

cwomack commented 9 months ago

With this issue having the same root cause as #4044, we'll close it in favor of that issue to track the progress on the feature request there. This is currently a limitation of the Cognito side, and not something that can be supported out of the box with Amplify right now.

The Cognito team is aware of this limitation, and we will provide an update within issue #4044 when we have made more progress.

hanoj-budime commented 9 months ago

I still don't understand why you're closing this issue.

This issue should remain open on your end until a solution is found.

hanoj-budime commented 9 months ago

@cwomack, @nadetastic.

Regarding this issue, before proceeding with closure, please ensure that the necessary changes are made from Cognito service team. Follow up on this process with high priority.

The related issue, #4044, has been open since September 19, 2019, almost three years now. Do you have any updates on this?