How to validate Authorization header with specific client in Spring Resource Server?

39 Views Asked by At

I have two spring boot services called Service1 and Service2. Service1 call API in Service2 along with the Authorization Header (JWT) which generated using org.springframework.boot:spring-boot-starter-oauth2-client with below configurations.

  security:
    oauth2:
      client:
        registration:
          demo:
            client-id: xxxxx
            client-secret: xxxxx
            authorization-grant-type: client_credentials
            client-authentication-method: client_secret_post
            scope:
            - openid
        provider:
          demo:
            token-uri: http://xxxxx/openid-connect/token

I want to validate this Authorization header in Service 2 with the specific client which dedicated to Service2.

Is there any way to validate JWT with the relevant client in Service2 with spring security built in feature using the spring resource server ?

0

There are 0 best solutions below