{"action":"closed","issue":{"url":"https://api.github.com/repos/aws/amazon-cognito-identity-js/issues/226","repository_url":"https://api.github.com/repos/aws/amazon-cognito-identity-js","labels_url":"https://api.github.com/repos/aws/amazon-cognito-identity-js/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/aws/amazon-cognito-identity-js/issues/226/comments","events_url":"https://api.github.com/repos/aws/amazon-cognito-identity-js/issues/226/events","html_url":"https://github.com/aws/amazon-cognito-identity-js/issues/226","id":195584803,"number":226,"title":"aws-cognito-sdk.min.js:21 Uncaught Error: AWS.CognitoSyncManager is not a constructor(…)","user":{"login":"amank12","id":3312926,"avatar_url":"https://avatars.githubusercontent.com/u/3312926?v=3","gravatar_id":"","url":"https://api.github.com/users/amank12","html_url":"https://github.com/amank12","followers_url":"https://api.github.com/users/amank12/followers","following_url":"https://api.github.com/users/amank12/following{/other_user}","gists_url":"https://api.github.com/users/amank12/gists{/gist_id}","starred_url":"https://api.github.com/users/amank12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amank12/subscriptions","organizations_url":"https://api.github.com/users/amank12/orgs","repos_url":"https://api.github.com/users/amank12/repos","events_url":"https://api.github.com/users/amank12/events{/privacy}","received_events_url":"https://api.github.com/users/amank12/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-14T16:50:50Z","updated_at":"2016-12-15T13:35:07Z","closed_at":"2016-12-15T13:35:07Z","body":"Here is the code :\r\n\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n\t<script src=\"jsbn.js\"></script>\r\n\t<script src=\"jsbn2.js\"></script>\r\n\t<script src=\"sjcl.js\"></script>\r\n\t\r\n\t\r\n\t<script src=\"https://sdk.amazonaws.com/js/aws-sdk-2.6.10.min.js\"></script>\r\n\t<script src=\"aws-cognito-sdk.min.js\"></script>\r\n\t<script src=\"amazon-cognito-identity.min.js\"></script>\r\n\t\r\n\t<script src=\"aws-sdk.js\"></script>\r\n\t<script src=\"amazon-cognito.min.js\"></script>\r\n\t\r\n\t\r\n\t\r\n</head>\r\n\r\n<body>\r\n\t  \r\n    <script>\r\n\r\n\tAWS.config.region = 'ap-northeast-2'; //This is required to derive the endpoint\r\n        \r\n    var poolData = { UserPoolId : 'ap-northeast-2_go0rGKVb5',\r\n        ClientId : '6a0n8dqpi9i7be9mtve36u6klm'\r\n    };\r\n\t\r\n\tvar authenticationData = {\r\n        Username : 'username',\r\n        Password : 'Password1#',\r\n    };\r\n    var authenticationDetails = new AWSCognito.CognitoIdentityServiceProvider.AuthenticationDetails(authenticationData);\r\n\t\r\n\tif ( authenticationDetails != null)\r\n\t\tconsole.log('Got Authentication');\r\n\t\r\n\tvar userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(poolData);\r\n\t\r\n\tif ( userPool != null)\r\n\t\tconsole.log('Got userPool');\r\n\t\t\r\n\t\r\n\t\r\n\t var userData = {\r\n        Username : 'username',\r\n        Pool : userPool\r\n    };\r\n    var cognitoUser = new AWSCognito.CognitoIdentityServiceProvider.CognitoUser(userData);\r\n\t\r\n\tif ( cognitoUser != null)\r\n\t\tconsole.log('Got cognitoUser');\r\n\t\t\r\n\tcognitoUser.authenticateUser(authenticationDetails, {\r\n        onSuccess: function (result) {\r\n            console.log('access token : ' + result.getAccessToken().getJwtToken());\r\n            console.log('idToken : ' + result.getIdToken().getJwtToken());\r\n\t\t\t\r\n\t\t\tAWS.config.credentials = new AWS.CognitoIdentityCredentials({\r\n\t\t\t\tIdentityPoolId: 'ap-northeast-2:8ea060bb-dbb5-484d-b2cf-bd786c48a396',\r\n\t\t\t\t\tLogins: {\r\n\t\t\t\t\t\t'cognito-idp.ap-northeast-2.amazonaws.com/ap-northeast-2_go0rGKVb5':   result.getIdToken().getJwtToken()\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tAWS.config.credentials.refresh(function (error) {\r\n\t\t\t\t\tif (error) {\r\n\t\t\t\t\t\tconsole.error(error);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.log('Successfully logged!');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t// Obtain AWS credentials\r\n\t\t\t\tAWS.config.credentials.get(function(){\t\t\t\t\t\r\n\t\t\t\t\tvar accessKeyId = AWS.config.credentials.accessKeyId;\r\n\t\t\t\t\tvar secretAccessKey = AWS.config.credentials.secretAccessKey;\r\n\t\t\t\t\tvar sessionToken = AWS.config.credentials.sessionToken;\r\n\t\t\t\t\t\r\n\t\t\t\t\tconsole.log(\"Access Key:\", AWS.config.credentials.accessKeyId);\r\n\t\t\t\t\tconsole.log(\"Secret Access Key:\", AWS.config.credentials.secretAccessKey);\r\n\t\t\t\t\tconsole.log(\"Session Token:\", AWS.config.credentials.sessionToken);\r\n\t\t\t\t});\r\n\t\t\t\tclient = new AWS.CognitoSyncManager();\r\n        },\r\n\r\n        onFailure: function(err) {\r\n            alert(err);\r\n        },\r\n\r\n    });\r\n\t\r\n\t</script>\r\n\t\r\n\t</body>\r\n</html>\r\n\r\nI have a federated identity that user Congnito to authenticate a user.  After authentication I want to add a dataset and attributes to the user.  In above code I am able to authenticate user but getting an error when I add AWS.CognitoSyncManager constructor.  Error message is : aws-cognito-sdk.min.js:21 Uncaught Error: AWS.CognitoSyncManager is not a constructor(…)"}}
{"actor":{"display_login":"amank12"}}