Skip to content

Running app locally with built-in authorizers does not use specified header #1675

@crazydevman

Description

@crazydevman

As per the documentation, we are able to define a built-in authorizer using the decorator function authorizer as in this example:
@app.authorizer(ttl_seconds=600, header="CustomHeader")

However, when running locally via the chalice local command, the 'header' parameter is ignored and the app will only accept the "authorization" header. The local app should instead use the value "CustomHeader".

Steps to reproduce:

  1. Follow example app from here: https://aws.github.io/chalice/topics/authorizers.html#built-in-authorizers
  2. Update the annotation to change the header field to "CustomHeader".
  3. Run the updated app via chalice local.
  4. Hit the endpoint as per the documentation except using "CustomHeader" instead of "Authorization". Notice how the request is rejected.

It appears that deployed apps do not have this issue, only when running locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions