amazon-archives / amazon-cognito-auth-js

The Amazon Cognito Auth SDK for JavaScript simplifies adding sign-up, sign-in with user profile functionality to web apps.
Apache License 2.0
424 stars 232 forks source link

amazon-cognito-auth.min.js:33 Error: Scopes have to be array type. #201

Closed michalgarcarz closed 4 years ago

michalgarcarz commented 4 years ago

Hello Team,

I have downloaded sample index.html along with dist/amazon-cognito-auth.min.js/. Filled in all the variables for my Cognito User Pools except:

IdentityProvider : '' Because i do not use identitypool, just userpool (need a simple web app just logging into Facebook and allowing to call Cognito User Pool protected API gateway calls).

and when running in FF or Chrome getting the error in console:

Error: Scopes have to be array type. amazon-cognito-auth.min.js:33:7533 e http://mydomain.s3-website.eu-central-1.amazonaws.com/amazon-cognito-auth.min.js:33

This error is displayed while calling initCognitoSDK().

My variable definitions:

function initCognitoSDK() { var authData = { ClientId : '7bb4vbbfxxxxxx', // Your client id here AppWebDomain : 'mydomain.com.auth.eu-central-1.amazoncognito.com', TokenScopesArray : 'email', // like ['openid','email','phone']... RedirectUriSignIn : 'https://mydomain.com, RedirectUriSignOut : 'https://mydomain.com', IdentityProvider : '', UserPoolId : 'eu-central-1_LMxxxxxx', AdvancedSecurityDataCollectionFlag : 'false' };

Where is my mistake ?

Thanks,

michalgarcarz commented 4 years ago

Sorry, my mistake, wrong type for scope :)