KEMBAR78
Add SPA sample using Backend For Frontend and Spring Cloud Gateway by jgrandja · Pull Request #1816 · spring-projects/spring-authorization-server · GitHub
Skip to content

Conversation

@jgrandja
Copy link
Collaborator

This SPA sample provides a reference implementation of the Backend For Frontend (BFF) application architecture pattern.

The spa-client is the frontend SPA implemented with Angular and the backend-for-spa-client is the backend application.

The backend-for-spa-client uses Spring Cloud Gateway to route /userinfo (UserInfo Endpoint) requests to demo-authorizationserver and /messages requests to messages-resource.

The backend-for-spa-client performs the authorization flows and stores the access tokens.

The spa-client is never exposed the access tokens and directly communicates with the backend-for-spa-client via an authenticated session cookie.

Related gh-297, gh-564

@jgrandja jgrandja self-assigned this Nov 14, 2024
@jgrandja jgrandja added the type: enhancement A general enhancement label Nov 14, 2024
@jgrandja jgrandja added this to the 1.4.0 milestone Nov 14, 2024
@jgrandja jgrandja merged commit a6d9c19 into spring-projects:main Nov 19, 2024
2 checks passed
@jgrandja jgrandja deleted the spa-bff-sample branch November 19, 2024 02:01
@amrnyang
Copy link

@jgrandja Hi, I read the code of spa-client and I saw that authorizeMessages() is called once for each request to /messages. Is this necessary?

@little3201
Copy link

why use spring-cloud-gateway-mvc not spring-cloud-gateway, would add samples with spring-cloud-gateway ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants