English 中文(简体)
失踪的Austhentication Token - AWS AP门户
原标题:Missing Authentication Token - AWS API gateway message

I have an API gateway get method. I can test it successfully using the test function. It calls a lambda function and returns sucessfully. However, copying the invoke URL of API gateway function into a broswer, I get the following error message:

{"message": "Missing Authentication Token"}
  1. I created an authorizer for my api gateway type is Lambda function Token source: method.request.header.Authorization Token validation - optional: None

  2. 我设立了授权的Lambda职能,作为以下法典:

export const handler = async (event) => {
    const token = event.authorizationToken;

    const policy = {
        principalId:  user123 , // Unique identifier for the user
        policyDocument: {
            Version:  2012-10-17 ,
            Statement: [
                {
                    Action:  execute-api:Invoke ,
                    Effect:  Allow ,
                    Resource:  arn:aws:execute-api:eu-north-1:xxx:c8mhri79ja/prod/*/* ,
                },
            ],
        },
    };

    return policy;
};
  1. 我设立了VPC,在为我的其他Lambda职能设置的安保小组后,我试图通过一个网关电话。

  2. AWSLambdaBasic ExecutionRole政策规定,与授权者Mlambda共同执行。

  3. 如果我从AAP网关处进行测试,则不会发生错误。 SO 门户和Mlambda功能正确运作。

  4. 如果在“URL”案的结尾处加上资源名称,我收到以下错误信息:

{"message": "Unauthorized"}

why I get the same arror message as I got without setting any Authorizers? How can I get rid of the error?

问题回答

您正在直接寻找活动标的标的——event.authorization Token 不存在。

申请标题上注明了标语,因此您的标语可能出现在以下网址:event.headers.authorization.headers.Authorization (





相关问题
Mount windows shared drive to MWAA in bootscript

In MWAA startup script sudo yum install samba-client cifs-utils -y sudo mount.cifs //dev/test/drop /mnt/dev/test-o username=testuser,password= pwd ,domain=XX Executing above commonds giving error - ...

How to get Amazon Seller Central orders programmatically?

We have been manually been keying Amazon orders into our system and would like to automate it. However, I can t seem to figure out how to go about it. Their documentation is barely there. There is: ...

Using a CDN like Amazon S3 to control access to media

I want to use Amazon S3/CloudFront to store flash files. These files must be private as they will be accessed by members. This will be done by storing each file with a link to Amazon using a mysql ...

unable to connect to database on AWS

actually I have my website build with Joomla hosted on hostmonster but all Joomla website need a database support to run this database is on AWS configuration files need to be updated for that I ...

Using EC2 Load Balancing with Existing Wordpress Blog

I currently have a virtual dedicated server through Media Temple that I use to run several high traffic Wordpress blogs. Both tend to receive sudden StumbleUpon traffic surges that (I m assuming) ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

热门标签