Description
Before opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
Angular
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
None
Environment information
System:
OS: Windows 11 10.0.26100
CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1255U
Memory: 5.24 GB / 15.73 GB
Binaries:
Node: 20.19.3 - C:\Program Files\nodejs\node.EXE
npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (135.0.3179.66)
Internet Explorer: 11.0.26100.1882
npmPackages:
@angular-devkit/build-angular: ^17.3.7 => 17.3.17
@angular-slider/ngx-slider: ^17.0.2 => 17.0.2
@angular/animations: ^17.3.9 => 17.3.12
@angular/cdk: ^16.2.14 => 16.2.14
@angular/cli: ^17.3.7 => 17.3.17
@angular/common: ^17.3.9 => 17.3.12
@angular/compiler: ^17.3.9 => 17.3.12
@angular/compiler-cli: ^17.3.9 => 17.3.12
@angular/core: ^17.3.9 => 17.3.12
@angular/elements: ^17.3.9 => 17.3.12
@angular/forms: ^17.3.9 => 17.3.12
@angular/localize: ^17.3.9 => 17.3.12
@angular/material: ^16.2.14 => 16.2.14
@angular/material-moment-adapter: ^16.2.14 => 16.2.14
@angular/platform-browser: ^17.3.9 => 17.3.12
@angular/platform-browser-dynamic: ^17.3.9 => 17.3.12
@angular/router: ^17.3.9 => 17.3.12
@aws-amplify/geo: ^3.0.51 => 3.0.82
@aws-amplify/geo/location-service: undefined ()
@aws/amazon-location-utilities-auth-helper: ^1.0.7 => 1.2.2
@fortawesome/angular-fontawesome: ^0.14.1 => 0.14.1
@fortawesome/fontawesome-svg-core: ^6.5.1 => 6.7.2
@fortawesome/free-regular-svg-icons: ^6.2.0 => 6.7.2
@fortawesome/free-solid-svg-icons: ^6.5.1 => 6.7.2
@maplibre/maplibre-gl-geocoder: ^1.9.0 => 1.9.0
@microsoft/signalr: ^8.0.0 => 8.0.7
@ng-bootstrap/ng-bootstrap: ^16.0.0 => 16.0.0
@ngrx/effects: ^17.2.0 => 17.2.0
@ngrx/store: ^17.2.0 => 17.2.0
@ngrx/store-devtools: ^17.2.0 => 17.2.0
@ngx-translate/core: ^14.0.0 => 14.0.0
@ngx-translate/http-loader: ^7.0.0 => 7.0.0
@popperjs/core: ^2.11.6 => 2.11.8
@sentry/angular-ivy: ^7.108.0 => 7.120.3
@sentry/cli: ^2.30.2 => 2.46.0
@types/datatables.net: ^1.10.24 => 1.10.28
@types/jasmine: ^4.3.0 => 4.6.5
@types/jquery: ^3.5.9 => 3.5.32
@types/js-levenshtein: ^1.1.3 => 1.1.3
@types/lodash.isequal: ^4.5.8 => 4.5.8
@types/mapbox__mapbox-gl-draw: ^1.4.6 => 1.4.9
@types/node: ^20.6.0 => 20.19.2
@types/node-forge: ^1.3.5 => 1.3.11
angular-cd-timer: ^3.0.0 => 3.0.0
angular-datatables: ^13.1.0 => 13.1.0
angularx-qrcode: ^17.0.1 => 17.0.1
aws-amplify: ^6.15.1 => 6.15.1
aws-amplify/adapter-core: undefined ()
aws-amplify/adapter-core/internals: 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/internals: undefined ()
aws-amplify/api/server: undefined ()
aws-amplify/auth: undefined ()
aws-amplify/auth/cognito: undefined ()
aws-amplify/auth/cognito/server: undefined ()
aws-amplify/auth/enable-oauth-listener: undefined ()
aws-amplify/auth/server: undefined ()
aws-amplify/data: undefined ()
aws-amplify/data/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 ()
bootstrap: ^5.2.2 => 5.3.7
datatables.net: ^1.11.3 => 1.13.11
datatables.net-bs5: ^1.11.3 => 1.13.11
document-register-element: ^1.7.2 => 1.14.10
flag-icons: ^6.6.6 => 6.15.0
google-libphonenumber: ^3.2.34 => 3.2.42
jasmine-core: ^4.4.0 => 4.6.1
jquery: ^3.6.1 => 3.7.1
jsvat: ^2.5.3 => 2.5.4
karma: ^6.4.1 => 6.4.4
karma-chrome-launcher: ^3.1.1 => 3.2.0
karma-coverage: ^2.2.0 => 2.2.1
karma-coverage-coffee-example: 1.0.0
karma-jasmine: ^5.1.0 => 5.1.0
karma-jasmine-html-reporter: ~1.7.0 => 1.7.0
levenshtein-edit-distance: ^3.0.1 => 3.0.1
lodash.isequal: ^4.5.0 => 4.5.0
maplibre-gl: ^5.6.0 => 5.6.0 ()
moment: ^2.30.1 => 2.30.1
nexus.frontend: file: => 4.4.0.2
ng-apexcharts: 1.8.0 => 1.8.0
ng-otp-input: ^2.0.6 => 2.0.8
ng2-completer: ^9.0.1 => 9.0.1
ngx-image-zoom: ^2.1.0 => 2.1.0
node-forge: ^1.3.1 => 1.3.1
node-forge-flash: 0.0.0
package: ^1.0.1 => 1.0.1
pdfmake: ^0.2.5 => 0.2.20
rxjs: ^6.6.7 => 6.6.7 (7.8.1, 7.8.2)
rxjs/ajax: undefined ()
rxjs/fetch: undefined ()
rxjs/internal-compatibility: undefined ()
rxjs/operators: undefined ()
rxjs/testing: undefined ()
rxjs/webSocket: undefined ()
test-package-json-file: 0.0.1
tslib: ^2.4.0 => 2.8.1 (2.6.2, 1.14.1)
typescript: ~5.4.5 => 5.4.5
uuid: ^9.0.1 => 9.0.1 (8.3.2)
zone.js: ^0.14.6 => 0.14.10
npmGlobalPackages:
@angular/cli: 20.0.3
source-map-explorer: 2.5.3
Describe the bug
Hello everyone!
I want to summarize how I use Amplify and what is the issue/problem find.
I'm implementing Amazon Cognito integration in our app using AWS Amplify. The first step is to migrate all existing user accounts from our database to Cognito using AWS Lambda, and then connect the app to Cognito through Amplify.
All works fine, and I'm able to signIn (with signIn() func ) to Cognito and manage new JWT tokens.
Then second step is to manage federated users, so instead to call signIn() func by call signInWithRedirect() but I got only an error
Expected behavior
I expected to try to connect and show hosted cognito UI
Reproduction steps
- Configure Amplify manually
- call signInWithRedirect()
Code Snippet
static AmplyConfig = {
Auth: {
Cognito: {
userPoolId: 'xxxxxxxxxxxxxx',
userPoolClientId: 'xxxxxxxxxxxxxxx',
identityPoolId: 'xxxxxxxxxxxxxxx',
LoginWith: {
// Hosted UI configuration
oauth: {
domain: 'xxxxxxxxxxxxxxx',
scopes: ['phone', 'email', 'profile', 'openid'],
redirectSignIn: ['http://localhost:3000/'],
redirectSignOut: ['http://localhost:3000/'],
responseType: 'code'
},
},
},
},
Geo: {
LocationService: {
region: 'xxxxxxxxxxxxxxxxx',
maps: {
items: {},
default: 'xxxxxxxxxxxxxxxxxxxx',
},
searchIndices: {
items: [xxxxxxxxxxxxxxxxxxxxxxxxxxx],
default: 'xxxxxxxxxxxxxxxxxxxxxx',
},
},
},
}
Amplify.configure(Config.AmplyConfig)
// THIS WORKS
public login(username: string, password: string): Promise<AuthSession> {
const promise = new Promise<any>(async (resolve, reject) => {
try {
let hash_pwd = this.cryptoUtils.getSHA256(username.toLowerCase() + password).toString()
// const signRedirect = await signInWithRedirect()
// console.log(signRedirect)
const nextStep: SignInOutput = await signIn({
username: username,
password: hash_pwd,
options: {
authFlowType: 'USER_PASSWORD_AUTH',
preferredChallenge: 'PASSWORD',
},
})
Util.debug(nextStep)
if (nextStep.isSignedIn && nextStep.nextStep.signInStep === 'DONE') {
try {
const fetchSession = await fetchAuthSession()
Util.debug(fetchSession)
if (window.sessionStorage) {
let obj = { isOnSession: true }
window.sessionStorage.setItem(fetchSession.userSub, JSON.stringify(obj))
}
resolve(fetchSession)
} catch (error) {
console.log(error)
reject(error)
}
} else {
reject('Error - login result for isSignedIn: ' + nextStep.isSignedIn + ' and nextStep: ' + nextStep.nextStep.signInStep)
}
} catch (error) {
console.log(error)
reject(error)
}
})
return promise
}
// THIS DOESN'T WORKS
public login(username: string, password: string): Promise<AuthSession> {
const promise = new Promise<any>(async (resolve, reject) => {
try {
const signRedirect = await signInWithRedirect()
console.log(signRedirect)
} catch (error) {
console.log(error)
reject(error)
}
})
return promise
}
Log output
// Put your logs below this line
AmplifyError {originalStack: 'Error: oauth param not configured.\n at new Zone…Unsub (http://localhost:4200/vendor.js:184403:10)', zoneAwareStack: 'Error: oauth param not configured.\n at new Ampl…p://localhost:4200/vendor.js:184403:10) [angular]', stack: 'Error: oauth param not configured.\n at new Ampl…p://localhost:4200/vendor.js:184403:10) [angular]', message: 'oauth param not configured.', name: 'OAuthNotConfigureException', …}
constructor
:
class AmplifyError
message
:
"oauth param not configured."
name
:
"OAuthNotConfigureException"
originalStack
:
"Error: oauth param not configured.\n at new ZoneAwareError (http://localhost:4200/vendor.js:193257:31)\n at new AmplifyError (http://localhost:4200/vendor.js:317625:5)\n at http://localhost:4200/vendor.js:317704:11\n at assertOAuthConfig (http://localhost:4200/vendor.js:319000:60)\n at http://localhost:4200/vendor.js:309293:89\n at Generator.next (<anonymous>)\n at asyncGeneratorStep (http://localhost:4200/vendor.js:362452:17)\n at _next (http://localhost:4200/vendor.js:362466:9)\n at http://localhost:4200/vendor.js:362471:7\n at new ZoneAwarePromise (http://localhost:4200/polyfills.js:6463:23)\n at http://localhost:4200/vendor.js:362463:12\n at _signInWithRedirect (http://localhost:4200/vendor.js:309315:30)\n at signInWithRedirect (http://localhost:4200/vendor.js:309287:30)\n at http://localhost:4200/main.js:22271:107\n at Generator.next (<anonymous>)\n at asyncGeneratorStep (http://localhost:4200/vendor.js:362452:17)\n at _next (http://localhost:4200/vendor.js:362466:9)\n at http://localhost:4200/vendor.js:362471:7\n at new ZoneAwarePromise (http://localhost:4200/polyfills.js:6463:23)\n at http://localhost:4200/vendor.js:362463:12\n at http://localhost:4200/main.js:22304:21\n at new ZoneAwarePromise (http://localhost:4200/polyfills.js:6463:23)\n at AuthService.login (http://localhost:4200/main.js:22266:21)\n at MergeMapSubscriber.project (http://localhost:4200/main.js:41102:77)\n at MergeMapSubscriber._tryNext (http://localhost:4200/vendor.js:186966:21)\n at MergeMapSubscriber._next (http://localhost:4200/vendor.js:186957:12)\n at MergeMapSubscriber.next (http://localhost:4200/vendor.js:184267:12)\n at WithLatestFromSubscriber._next (http://localhost:4200/vendor.js:188148:26)\n at WithLatestFromSubscriber.next (http://localhost:4200/vendor.js:184267:12)\n at TapSubscriber._next (http://localhost:4200/vendor.js:187898:22)\n at TapSubscriber.next (http://localhost:4200/vendor.js:184267:12)\n at FilterSubscriber._next (http://localhost:4200/vendor.js:186438:24)\n at FilterSubscriber.next (http://localhost:4200/vendor.js:184267:12)\n at ScannedActionsSubject.next (http://localhost:4200/vendor.js:184045:17)\n at SafeSubscriber._next (http://localhost:4200/vendor.js:356577:24)\n at SafeSubscriber.__tryOrUnsub (http://localhost:4200/vendor.js:184403:10)\n at SafeSubscriber.next (http://localhost:4200/vendor.js:184343:14)\n at Subscriber._next (http://localhost:4200/vendor.js:184290:22)\n at Subscriber.next (http://localhost:4200/vendor.js:184267:12)\n at ScanSubscriber._tryNext (http://localhost:4200/vendor.js:187345:22)\n at ScanSubscriber._next (http://localhost:4200/vendor.js:187333:19)\n at ScanSubscriber.next (http://localhost:4200/vendor.js:184267:12)\n at http://localhost:4200/vendor.js:356700:48\n at _ZoneDelegate.invoke (http://localhost:4200/polyfills.js:4211:158)\n at Object.onInvoke (http://localhost:4200/vendor.js:242762:25)\n at _ZoneDelegate.invoke (http://localhost:4200/polyfills.js:4211:46)\n at ZoneImpl.run (http://localhost:4200/polyfills.js:3982:35)\n at NgZone.run (http://localhost:4200/vendor.js:242616:24)\n at Object.next (http://localhost:4200/vendor.js:356700:27)\n at SafeSubscriber.__tryOrUnsub (http://localhost:4200/vendor.js:184403:10)"
recoverySuggestion
:
"Make sure to call Amplify.configure with oauth parameter in your app."
stack
:
"Error: oauth param not configured.\n at new AmplifyError (http://localhost:4200/vendor.js:317625:5) [angular]\n at http://localhost:4200/vendor.js:317704:11 [angular]\n at assertOAuthConfig (http://localhost:4200/vendor.js:319000:60) [angular]\n at http://localhost:4200/vendor.js:309293:89 [angular]\n at Generator.next (<anonymous>) [angular]\n at asyncGeneratorStep (http://localhost:4200/vendor.js:362452:17) [angular]\n at _next (http://localhost:4200/vendor.js:362466:9) [angular]\n at http://localhost:4200/vendor.js:362471:7 [angular]\n at new ZoneAwarePromise (http://localhost:4200/polyfills.js:6463:23) [angular]\n at http://localhost:4200/vendor.js:362463:12 [angular]\n at _signInWithRedirect (http://localhost:4200/vendor.js:309315:30) [angular]\n at signInWithRedirect (http://localhost:4200/vendor.js:309287:30) [angular]\n at http://localhost:4200/main.js:22271:107 [angular]\n at Generator.next (<anonymous>) [angular]\n at asyncGeneratorStep (http://localhost:4200/vendor.js:362452:17) [angular]\n at _next (http://localhost:4200/vendor.js:362466:9) [angular]\n at http://localhost:4200/vendor.js:362471:7 [angular]\n at new ZoneAwarePromise (http://localhost:4200/polyfills.js:6463:23) [angular]\n at http://localhost:4200/vendor.js:362463:12 [angular]\n at http://localhost:4200/main.js:22304:21 [angular]\n at new ZoneAwarePromise (http://localhost:4200/polyfills.js:6463:23) [angular]\n at AuthService.login (http://localhost:4200/main.js:22266:21) [angular]\n at MergeMapSubscriber.project (http://localhost:4200/main.js:41102:77) [angular]\n at MergeMapSubscriber._tryNext (http://localhost:4200/vendor.js:186966:21) [angular]\n at MergeMapSubscriber._next (http://localhost:4200/vendor.js:186957:12) [angular]\n at MergeMapSubscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at WithLatestFromSubscriber._next (http://localhost:4200/vendor.js:188148:26) [angular]\n at WithLatestFromSubscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at TapSubscriber._next (http://localhost:4200/vendor.js:187898:22) [angular]\n at TapSubscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at FilterSubscriber._next (http://localhost:4200/vendor.js:186438:24) [angular]\n at FilterSubscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at ScannedActionsSubject.next (http://localhost:4200/vendor.js:184045:17) [angular]\n at SafeSubscriber._next (http://localhost:4200/vendor.js:356577:24) [angular]\n at SafeSubscriber.__tryOrUnsub (http://localhost:4200/vendor.js:184403:10) [angular]\n at SafeSubscriber.next (http://localhost:4200/vendor.js:184343:14) [angular]\n at Subscriber._next (http://localhost:4200/vendor.js:184290:22) [angular]\n at Subscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at ScanSubscriber._tryNext (http://localhost:4200/vendor.js:187345:22) [angular]\n at ScanSubscriber._next (http://localhost:4200/vendor.js:187333:19) [angular]\n at ScanSubscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at http://localhost:4200/vendor.js:356700:48 [angular]\n at Object.onInvoke (http://localhost:4200/vendor.js:242762:25) [angular]\n at NgZone.run (http://localhost:4200/vendor.js:242616:24) [angular]\n at Object.next (http://localhost:4200/vendor.js:356700:27) [angular]\n at SafeSubscriber.__tryOrUnsub (http://localhost:4200/vendor.js:184403:10) [angular]"
underlyingError
:
undefined
zoneAwareStack
:
"Error: oauth param not configured.\n at new AmplifyError (http://localhost:4200/vendor.js:317625:5) [angular]\n at http://localhost:4200/vendor.js:317704:11 [angular]\n at assertOAuthConfig (http://localhost:4200/vendor.js:319000:60) [angular]\n at http://localhost:4200/vendor.js:309293:89 [angular]\n at Generator.next (<anonymous>) [angular]\n at asyncGeneratorStep (http://localhost:4200/vendor.js:362452:17) [angular]\n at _next (http://localhost:4200/vendor.js:362466:9) [angular]\n at http://localhost:4200/vendor.js:362471:7 [angular]\n at new ZoneAwarePromise (http://localhost:4200/polyfills.js:6463:23) [angular]\n at http://localhost:4200/vendor.js:362463:12 [angular]\n at _signInWithRedirect (http://localhost:4200/vendor.js:309315:30) [angular]\n at signInWithRedirect (http://localhost:4200/vendor.js:309287:30) [angular]\n at http://localhost:4200/main.js:22271:107 [angular]\n at Generator.next (<anonymous>) [angular]\n at asyncGeneratorStep (http://localhost:4200/vendor.js:362452:17) [angular]\n at _next (http://localhost:4200/vendor.js:362466:9) [angular]\n at http://localhost:4200/vendor.js:362471:7 [angular]\n at new ZoneAwarePromise (http://localhost:4200/polyfills.js:6463:23) [angular]\n at http://localhost:4200/vendor.js:362463:12 [angular]\n at http://localhost:4200/main.js:22304:21 [angular]\n at new ZoneAwarePromise (http://localhost:4200/polyfills.js:6463:23) [angular]\n at AuthService.login (http://localhost:4200/main.js:22266:21) [angular]\n at MergeMapSubscriber.project (http://localhost:4200/main.js:41102:77) [angular]\n at MergeMapSubscriber._tryNext (http://localhost:4200/vendor.js:186966:21) [angular]\n at MergeMapSubscriber._next (http://localhost:4200/vendor.js:186957:12) [angular]\n at MergeMapSubscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at WithLatestFromSubscriber._next (http://localhost:4200/vendor.js:188148:26) [angular]\n at WithLatestFromSubscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at TapSubscriber._next (http://localhost:4200/vendor.js:187898:22) [angular]\n at TapSubscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at FilterSubscriber._next (http://localhost:4200/vendor.js:186438:24) [angular]\n at FilterSubscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at ScannedActionsSubject.next (http://localhost:4200/vendor.js:184045:17) [angular]\n at SafeSubscriber._next (http://localhost:4200/vendor.js:356577:24) [angular]\n at SafeSubscriber.__tryOrUnsub (http://localhost:4200/vendor.js:184403:10) [angular]\n at SafeSubscriber.next (http://localhost:4200/vendor.js:184343:14) [angular]\n at Subscriber._next (http://localhost:4200/vendor.js:184290:22) [angular]\n at Subscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at ScanSubscriber._tryNext (http://localhost:4200/vendor.js:187345:22) [angular]\n at ScanSubscriber._next (http://localhost:4200/vendor.js:187333:19) [angular]\n at ScanSubscriber.next (http://localhost:4200/vendor.js:184267:12) [angular]\n at http://localhost:4200/vendor.js:356700:48 [angular]\n at Object.onInvoke (http://localhost:4200/vendor.js:242762:25) [angular]\n at NgZone.run (http://localhost:4200/vendor.js:242616:24) [angular]\n at Object.next (http://localhost:4200/vendor.js:356700:27) [angular]\n at SafeSubscriber.__tryOrUnsub (http://localhost:4200/vendor.js:184403:10) [angular]"
[[Prototype]]
:
Error
aws-exports.js
No response
Manual configuration
static AmplyConfig = {
Auth: {
Cognito: {
userPoolId: 'xxxxxxxxxxxxxx',
userPoolClientId: 'xxxxxxxxxxxxxxx',
identityPoolId: 'xxxxxxxxxxxxxxx',
LoginWith: {
// Hosted UI configuration
oauth: {
domain: 'xxxxxxxxxxxxxxx',
scopes: ['phone', 'email', 'profile', 'openid'],
redirectSignIn: ['http://localhost:3000/'],
redirectSignOut: ['http://localhost:3000/'],
responseType: 'code'
},
},
},
},
Geo: {
LocationService: {
region: 'xxxxxxxxxxxxxxxxx',
maps: {
items: {},
default: 'xxxxxxxxxxxxxxxxxxxx',
},
searchIndices: {
items: [xxxxxxxxxxxxxxxxxxxxxxxxxxx],
default: 'xxxxxxxxxxxxxxxxxxxxxx',
},
},
},
}
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