chapter four

4 Building a single-page application to talk to microservices

 

This chapter covers

  • What is a single-page application (SPA), its benefits and drawbacks
  • How to build a SPA using AngularJS and Spring Boot to talk to microservices
  • How to overcome Cross-Origin Resource Sharing (CORS) related issues
  • How to login to a SPA with OpenID Connect

4.1   Building a single-page application

4.1.1   Building a single-page application with AngularJS

4.1.2   Benefits of a SPA over an MPA

4.1.3   Drawbacks of a SPA compared with an MPA

4.2   Introducing an API gateway, and setting up cross-origin resource sharing (CORS)

4.2.1   Running the sample

4.2.2   The same-origin policy

4.2.3   Cross-origin resource sharing (CORS)

4.2.4   Inspecting the source that allows cross-origin requests

4.2.5   Proxying the resource server with an API gateway

4.3   Securing a SPA with OpenID Connect

4.3.1   OpenID Connect

4.3.2   Obtaining an ID token

4.3.3   OpenID Connect in practice

4.3.4   Where does OpenID Connect fit in?

4.4   Federated authentication

4.4.1   Multiple trust domains

4.4.2   Building trust between domains

4.5   Summary