Open
Description
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:
- We obtain JWTs from a Spring OAuth2 server.
- We supply the JWT as a bearer token in the
Authorization
header to each gRPC request. - 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 theauthorities
claim array.
d. Set the Spring Security principal to include all authorities in the JWT. - 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.