[英]NativeFirebaseError: [storage/unauthorized] User is not authorized to perform the desired action
[英]AWS Elemental Media Converter - Cognito unauthorized user not allowed to perform action
我正在尝试创建基本媒体转换器作业,以便对我的 S3 存储桶中的一些视频文件进行转码。
这是我的后端代码
const client = new MediaConvertClient({
region: 'us-east-1',
endpoint: 'https://abcdefghi.mediaconvert.us-east-1.amazonaws.com',
credentials: fromCognitoIdentityPool({
clientConfig: { region: 'us-east-1' },
identityPoolId: 'us-east-1:xxxx-xxx-xxx-xxx-xxxxxxx',
})
});
const command = new CreateJobCommand(job);
const response = await client.send(command);
作为job
object 我正在使用从媒体转换控制台复制的 JSON object 成功完成的工作。 运行此代码后,出现以下错误:
Error: AccessDeniedException: User: arn:aws:sts::XXXXX:assumed-role/Cognito_MyAppElementalMediaConverterUnauth_Role/CognitoIdentityCredentials is not authorized to perform: mediaconvert:CreateJob on resource: *
我在控制台中创建了 Cognito 身份池,并将以下策略附加到未经身份验证的角色:
更新:
将端点 uri 添加到MediaConvertClient()
后,我能够进行身份验证,但现在我得到了
AccessDeniedException: User: arn:aws:sts::XXXXXXX:assumed-role/Cognito_MyAppeElementalMediaaConverterUnauth_Role/CognitoIdentityCredentials is not authorized to perform: iam:PassRole on resource: arn:aws:iam::XXXXX:role/*
即使我已经在 AWS 控制台中为Cognito_MyAppeElementalMediaaConverterUnauth_Role
添加了这些权限
这看起来像是 IAM 配置问题或身份验证问题。 我建议尝试一个不需要写入权限的命令,例如对 MediaConvert 的“list-jobs”调用,以便首先调试身份验证链。 我还建议从本地 AWS CLI 或设置了详细标志的 CloudShell 单独尝试这些命令,以便您可以看到有关错误的更多详细信息。
关于 PassRole 命令,可以在这里获得更多信息: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.