【发布时间】:2021-05-22 06:51:49
【问题描述】:
我正在考虑使用 AWS Pinpoint 将推送通知发送到我的 react 本机应用程序。然而,未经身份验证的用户似乎能够为他们希望的任何用户更新用户属性,即没有访问控制。我是移动开发的新手,但是将这样的东西放入前端不是安全问题吗?如果它是一个 Web 应用程序,人们将能够检查网络调用以获取凭据并拨打他们希望拨打updateEndpoint 的任何电话。这不适用于移动应用还是我误解了什么?
详情:
设置中有一个步骤显示Edit the IAM policy document for unauthenticated identities to allow permissions for the mobiletargeting:PutEvents and mobiletargeting:UpdateEndpoint actions
提供的 react native 代码 sn-p 如下:
import Analytics from '@aws-amplify/analytics';
import Auth from '@aws-amplify/auth';';
const amplifyConfig = {
Auth: {
identityPoolId: 'COGNITO_IDENTITY_POOL_ID',
region: 'ap-south-1'
}
}
//Initialize Amplify
Auth.configure(amplifyConfig);
const analyticsConfig = {
AWSPinpoint: {
// Amazon Pinpoint App Client ID
appId: 'cd73a57d200e49e2bc4b97d6ebf63cd4',
// Amazon service region
region: 'ap-south-1',
mandatorySignIn: false,
}
}
Analytics.configure(analyticsConfig)
Analytics.updateEndpoint({
attributes: {
interests: ['science', 'politics', 'travel'],
//..
},
userId: 'UserIdValue',
userAttributes: {
username: 'ilovethecloud'
}
});
【问题讨论】:
标签: amazon-web-services aws-pinpoint