Skip to content

Config for OAuth2 JWT Security with Shared Keys #244

Open
@pluttrell

Description

@pluttrell

How would you configure the starter to work with OAuth2 JWTs using shared signing keys in a reactive gRPC service?

We see this example, but it's non-reactive, uses OpenId and uses a Keycloak server to validate the JWTs.

Here's more detail on our use case, which we think is pretty standard:

  1. We obtain JWTs from a Spring OAuth2 server.
  2. We supply the JWT as a bearer token in the Authorization header to each gRPC request.
  3. We need the server to the following on each call:
    a. Retrieve the JWT from the header.
    b. Validate the signature using a shared symmetric key that we'll provide to the service.
    c. Parse the JWT, extracting the authorities claim array.
    d. Set the Spring Security principal to include all authorities in the JWT.
  4. Then we'll be able to annotate our service methods with @PreAuthorize("hasAuthority('some-right')").

Also we're using reactive gRPC, so need to leverage Reactive Spring Security.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    examplesEverything related to examples

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions