ashim888 / awis

A python script to query Amazon's Alexa Web Information Service (AWIS).
GNU General Public License v3.0
37 stars 18 forks source link

authorization problem #18

Open mikkokotila opened 6 years ago

mikkokotila commented 6 years ago

Hello, I installed form pip and am doing:

from myawis import *

access = 'x'
secret = 'x'

obj = CallAwis(access, secret)
urlinfo = obj.urlinfo("www.example.com")

and I get:

{'OutputTimestamp': '20180520T152730Z',
 'Request.Errors.Error.ErrorCode': '"User: '
                                   'arn:aws:iam::192208424764:user/alexa is '
                                   'not authorized to perform: awis:GET on '
                                   'resource: '
                                   'arn:aws:awis:us-west-1:192208424764:/api"'}

But this credential is ok in the AWS side. Any ideas?

luzihang123 commented 5 years ago

Hello, I installed form pip and am doing:

from myawis import *

access = 'x'
secret = 'x'

obj = CallAwis(access, secret)
urlinfo = obj.urlinfo("www.example.com")

and I get:

{'OutputTimestamp': '20180520T152730Z',
 'Request.Errors.Error.ErrorCode': '"User: '
                                   'arn:aws:iam::192208424764:user/alexa is '
                                   'not authorized to perform: awis:GET on '
                                   'resource: '
                                   'arn:aws:awis:us-west-1:192208424764:/api"'}

But this credential is ok in the AWS side. Any ideas?

I had the same problem. Have you solved it?

mowshon commented 5 years ago

@mikkokotila @luzihang123

Your user doesn't have permissions. Just grant all permissions like in the screen below.

first

second

kevinstubbs commented 5 years ago

@mikkokotila and @luzihang123 this IAM policy is working for me (from the documentation https://aws.amazon.com/awis/getting-started/)

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "awis:GET"
            ],
            "Effect": "Allow",
            "Resource": "*"
        }
    ]
}