S
S
schwarzstern2019-01-21 16:56:30
Java
schwarzstern, 2019-01-21 16:56:30

How to set up OAuth2 security for Spring Cloud Stream?

I am developing a microservice application. I use Spring Cloud Data Flow as the main framework, and RabbitMQ as a message broker. Microservices communicate with each other through a broker, REST-endpoints are available only on the gateway for interacting with the client, and the gateway is also an authentication server that issues an oauth token. I want to set up authorization locally on each microservice (global authentication, local authorization approach). Microservices process incoming messages on the bus using methods marked with the @StreamListener annotation. My problem is that I can't figure out how to set up security for them and, accordingly, how to hang @PreAuthorize on these methods.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question