Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
934 views
in Technique[技术] by (71.8m points)

amazon-web-services - 谁能为我提供共享授权的无服务器示例?(Can anyone provide me an example in serverless where authorization is shared?)

I have tried this in my authorization function also there needs to cookies to be validated which i am unable to get.

(我已经在我的授权功能中尝试过此操作,并且还需要验证我无法获得的cookie。)

I have tried using this https://serverless.com/framework/docs/providers/aws/events/apigateway/#share-api-gateway-and-api-resources But could not do it.Please help thanks in advance.

(我已尝试使用此https://serverless.com/framework/docs/providers/aws/events/apigateway/#share-api-gateway-and-api-resources但无法做到这一点。请提前帮助。)

 service: shared-gateway
provider:
  name: aws
  runtime: nodejs8.10
  region: ap-southeast-1
  endpointType: REGIONAL
resources:
  Resources:
    SharedGW:
      Type: AWS::ApiGateway::RestApi
      Properties:
        Name: SharedGW
        EndpointConfiguration: 
          Types: 
            - REGIONAL
    ApiGatewayAuthorizer:
      Type: AWS::ApiGateway::Authorizer
      Properties:
        AuthorizerResultTtlInSeconds: 300
        IdentitySource: method.request.header.Authorization
        Name: SharedGWAuth
        RestApiId:
          Ref: SharedGW
        Type: REQUEST       


  Outputs:
    apiGatewayRestApiId:
      Value:
        Ref: SharedGW
      Export:
        Name: SharedGW-restApiId
    apiGatewayRestApiRootResourceId:
      Value:
        Fn::GetAtt:
          - SharedGW
          - RootResourceId
      Export:
        Name: SharedGW-rootResourceId
  ask by gourabk translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...