Skip to content

Configuration of JWK for JWT Creation for extensions requests #2680

@cwperks

Description

@cwperks

This issue is P1--Do only if last task available

For the initial implementation, the JWT will be signed with an HMAC 512 secret signing key known to the security plugin. User's should have the ability to customize the JWK (JSON Web Key) that is used to sign the token passed to an extension.

Below is an example configuration for an Elliptic Curve based signature. RFC for JSON Web Key:

jwt_signing_key:
    kty: EC // (Key Type) Parameter
    alg: ES256 // (Algorithm) Parameter
    crv: P-256
    use: sig // (Public Key Use) Parameter
    d: '870MB6gfuTJ4HtUnUvYMyJpr5eUZNP4Bk43bVdj3eAE'
    x: 'MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4'
    y: '4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM'

A PR was introduced in the feature/extensions branch that allows for the creation of JWTs. Currently this only works for HMAC 512 as mentioned. To make the existing code configurable, a configuration field will need to be added to the security configuration file and then parsed into the settings.

After adding that ability, you will want to add various different configuration options based on some of the most common types of signature algorithms. Then you can test that the configuration file is being parsed correctly for these types.

Next, you will want to go into the JWTVendor class added into the branch and make it compatible with the new configuration options. Tests for this part will look like the existing JWTVendor tests but use the difference configuration options.

Completion of this issue will look like a PR (or two) which introduces the above features and associated tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triagedIssues labeled as 'Triaged' have been reviewed and are deemed actionable.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions