Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'identitySource' needs to accept array of headers in TokenAuthorizer #6330

Closed
2 tasks
rampatina opened this issue Feb 18, 2020 · 1 comment
Closed
2 tasks
Assignees
Labels
@aws-cdk/aws-apigateway Related to Amazon API Gateway closing-soon This issue will automatically close in 4 days unless further comments are made. feature-request A feature should be added or improved.

Comments

@rampatina
Copy link

Use Case

Getting below error if I pass array of headers as we need to provide for 'identitySource' in 'TokenAuthorizer'.
Invalid token source expression: method.request.header.authorization, method.request.header.appkey. The source must be a method request header, matching 'method.request.header.[a-zA-Z0-9._-]+'

Example token authorizer which we tried:

const customAuth1 = new apigw.TokenAuthorizer(this, 'customAuthorizer1', {
      handler: customAuthorizer.jwtValidatorConstruct.handler,
      identitySource: 'method.request.header.authorization,method.request.header.appkey',
      resultsCacheTtl: resultTtlInSeconds,
      authorizerName: 'customAuthorizer1'
    });

Proposed Solution

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@rampatina rampatina added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 18, 2020
@SomayaB SomayaB added the @aws-cdk/aws-apigateway Related to Amazon API Gateway label Feb 19, 2020
@nija-at
Copy link
Contributor

nija-at commented Feb 20, 2020

From what I can tell from the documentation, token based authorizers don't support only a single header. This is consistent with the documented input protocol for the lambda function that backs the token authorizer - the value of the specified header is part of authorizationToken key in the function's input.

If you're instead looking for the request authorizer, that's currently being implemented in #5642.

@nija-at nija-at added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. closing-soon This issue will automatically close in 4 days unless further comments are made. and removed needs-triage This issue or PR still needs to be triaged. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Feb 20, 2020
@nija-at nija-at closed this as completed Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-apigateway Related to Amazon API Gateway closing-soon This issue will automatically close in 4 days unless further comments are made. feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants