Skip to content

Getting autentication error if JWT does not contain kid header #1502

@hoegertn

Description

@hoegertn

Describe the bug
When using a JWT guard with keys specified in the zilla config file and the request token does not contain the kid header authentication fails.

I assume the error is somewhere near:

As the kid seems to be used to look up the key without a fall back.

To Reproduce
Steps to reproduce the behavior:

  1. Configure Zilla as described here: https://docs.aklivity.io/zilla/latest/reference/config/guards/jwt.html
  2. Send a request with a JWT that does not contain a kid claim in the header
  3. See error in Zilla verbose log "GUARD_JWT_AUTHORIZATION_FAILED JWT token authorization failed for identity (). Invalid alg or key."

Expected behavior
Zilla figures out an appropriate key from the guard config.

Zilla Environment:

Start CMD for docker container

CMD ["start", "-v", "-e", "-Pzilla.engine.verbose=true", "-Pzilla.engine.debug=true"]

Attach the zilla.yaml config file:

https://docs.aklivity.io/zilla/latest/reference/config/guards/jwt.html

Client Environment:

curl request with JWT

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions