AWS SDK and Amazon Cognito Identity JS
See original GitHub issueDescribe the bug It seems the amazon-cognito-identity-js library and AWS SDK are inconsistent. Please correct me if I’m wrong.
What I’m trying to do is just use the cognito-identity-js library appropriately through the AWS-SDK as documented:
var poolData = {
UserPoolId : '...', // Your user pool id here
ClientId : '...' // Your client id here
};
var userPool = new AmazonCognitoIdentity.CognitoUserPool(poolData);
To Reproduce
const AWS = require('aws-sdk');
console.log(Object.keys(AWS)); //AmazonCognitoIdentity nor CognitoUserPool exist on this
const ci = AWS.CognitoIdentity
console.log(ci); //Nor on this
console.log(AWS.CognitoIdentityServiceProvider) //Nor on this.
Expected behavior Some way to access a user pool that is documented on the amazon-cognito-identity-js library.
Additional context I understand amplify is for client side apps. But most of us seem to have some need of cognito usage on the server side. It is taking tons of time to figure out.
You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = ‘DEBUG’; in your app.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Cognito Identity Provider Client - AWS SDK for JavaScript v3
AWS SDK for JavaScript CognitoIdentityProvider Client for Node.js, Browser and React Native. Using the Amazon Cognito user pools API, you can create a...
Read more >amazon-cognito-identity-js - npm
The Amazon Cognito Identity SDK for JavaScript allows JavaScript enabled applications to sign-up users, authenticate users, view, delete, and ...
Read more >Amplify vs amazon-cognito-identity-js vs AWS SDK
amazon -cognito-identity-js # · Does it work in the backend? · When used on the frontend, it provides lower level (compared to Amplify)...
Read more >Using Amazon Cognito Identity to authenticate users
// Import required AWS SDK clients and command for Node.js import {S3Client} from "@aws-sdk/client-s3"; import ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@elorzafe @undefobj thank you for confirming this approach. though it slightly worries me that the SDK returns a
UserAttributes
object array ofValue, Key
object pairs instead of an object as it seems strange and non-deterministic.It’s confusing to have it return an array and so I’ve even implemented a check:
Though I believe this may be a separate issue for another repo such as aws-sdk-js
Otherwise, thank you again for your help. I’ve closed this issue.
@stephenhuh we create this RFC to see what features would you like to see in the future related to Auth Admin Tasks.