'VueJS app with BFF framework using Azure AD

I am working on VueJS SPA, which connects to Web API protected by Azure AD. I would like to implement the BFF Pattern(Backend for FrontEnd), which improve the security of the application where the token management happens on the server side. I could not find good examples using Azure AD identity. Appreciate if someone could share any good example that helps as a template for BFF using SPA framework.



Solution 1:[1]

Please check if below references can give an idea .

This demo will show implementation of SPA in Angular but this could easily be switched with Blazor, React or a Vue.js UI.

An API is created specially for the Angular UI and the other APIs can only be able to access from the trusted backend which can be under our control.

This is almost similar to the backend for frontend application architecture (BFF). The API uses Microsoft.Identity.Web to implement the Azure AD security. All API HTTP requests to this service require a valid access token which was created for the service.

References:

  1. asp.net - SPA (Vue), BFF and IdentityServer on IIS setup? - Stack Overflow
  2. Securing and accessing APIs with Azure Active Directory | by Cheranga Hatangala |

Other- references:

  1. Building and securing an ASP.NET Core API with a hosted Vue.js UI (damienbod.com)
  2. c# - How to serve SPA on root using Azure AD's AuthorizeforScopes in a BFF - Stack Overflow
  3. Does MSAL.js support the check_session_iframe OIDC endpoint? - Stack Overflow

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kavyasaraboju-MT