how to secure API with mod_auth_openidc

469 views Asked by At

I have 3 applications

  • old JSP based java app
  • Spring Boot webapp
  • SPA
  • 5 java micro services REST API built using Spring Boot

I need to secure all of them at the same time. I have picked keycloak as it seemed like a good idea. As we are using Apache for reverse proxy. We have picked mod_auth_openidc to limit access to services at reverse proxy level.

We have built Extensions for Spring Webapp and old JSP app to use headers provided by mod_auth_openidc to handle active users and aithentication.

At this point now we have run into the issue that the we also secured the APIs using mod_auth_openidc headers. Although this has a serious drawback as APIs can not talk to each other just using JWT tokens as the reverse proxy needs them to be authenticated.

Should we secure the APIs using JWT only instead ?

Any mod_auth_openidc guru knows the best approach to this scenario?

I need the REST API to be able to talk to each other without any user interaction. E.g. only using tokens.

Our webapps ( JSP and SPA ) are always fully secured e.g. the user has to be logged in to access any part of it.

I would appreciate any suggestions.

Thanks

0

There are 0 answers