This looks like an awesome new tool. Can you help me answer the following question?
When not using aws-amplify-react or aws-amplify-react-native what is the main benefit of using the AWS Amplify Auth module over using Cognito directly?
Goal of AWS Amplify Auth is to make common tasks easy, let developer focus on their business differentiators.
Amazon Cognito signUp:
var poolData = {
UserPoolId : '...', // Your user pool id here
ClientId : '...' // Your client id here
};
var userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(poolData);
var attributeList = [];
var dataEmail = {
Name : 'email',
Value : '[email protected]'
};
var dataPhoneNumber = {
Name : 'phone_number',
Value : '+15555555555'
};
var attributeEmail = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserAttribute(dataEmail);
var attributePhoneNumber = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserAttribute(dataPhoneNumber);
attributeList.push(attributeEmail);
attributeList.push(attributePhoneNumber);
userPool.signUp('username', 'password', attributeList, null, function(err, result){
if (err) {
alert(err);
return;
}
cognitoUser = result.user;
console.log('user name is ' + cognitoUser.getUsername());
});
AWS Amplify signUp:
Amplify.configure(aws_exports);
Auth.signUp('username', 'password', '[email protected]', '+15555555555')
.then(user => console.log(user))
.catch(err => console.log(err));
Amplify also manages AWS Credentials gathered from Amazon Cognito Federated Identities (the above example is for Amazon Cognito User Pools). For example Instead of following this process and then signing, such as sending requests to Amazon API Gateway, Amplify does this all under the covers for you.
Most helpful comment
Goal of AWS Amplify Auth is to make common tasks easy, let developer focus on their business differentiators.
Amazon Cognito signUp:
AWS Amplify signUp: