In this article, we will learn how to implement Service to Service Communication using Client Credentials Flow. We will create the archival-service in which we will use a scheduler job to invoke the messages-service APIs to archive the messages. For implementing this, we will use Client Credentials Flow. We will also implement POST /api/messages/archive API endpoint in archival-service which can only be called by users who have ROLE_ADMIN role. Considering this, archival-service will act as a Resource Server and as a Client too.
Continue reading »![Spring Security OAuth 2 Tutorial - 10 : Service to Service Communication using Client Credentials Flow](/preview-images/spring-security-oauth2-part10.webp)