AWS API Gateway custom Authorizer strange showing error

前端 未结 5 1986
悲哀的现实
悲哀的现实 2021-02-05 04:10

Here is the context:

  • I set up a resource in the API gateway. /user/company
  • This resource have 2 methods. Get and POST.
  • I have configured a custom
5条回答
  •  故里飘歌
    2021-02-05 04:42

    In the your custom policy build code use, the node js module aws-auth-policy The Nodejs part you can use ,

    AuthPolicy.prototype.allowAllMethods = function () {
      addMethod.call(this, "allow", "*", "*", null);
    }
    

    In the code

    const AuthPolicy = require('aws-auth-policy');
      const policy = new AuthPolicy(principalId, awsAccountId, apiOptions);
               // policy.allowMethod(method, resource);
                policy.allowAllMethods();
                const authResponse = policy.build();
    

提交回复
热议问题