问题描述
我正在考虑使用 AWS Pinpoint 向我的 React Native 应用程序发送推送通知。然而,未经身份验证的用户似乎能够为他们希望的任何用户更新用户属性,即没有访问控制。我是移动开发的新手,但是将这样的东西放到前端不是一个安全问题吗?如果它是一个 Web 应用程序,人们将能够检查网络调用以获取凭据并进行任何他们希望 updateEndpoint
的调用。这不适用于移动应用还是我误解了什么?
详情:
设置中有一个步骤 Edit the IAM policy document for unauthenticated identities to allow permissions for the mobiletargeting:PutEvents and mobiletargeting:UpdateEndpoint actions
React Native 提供的代码片段如下:
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'
}
});
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)