Following software architecture:
Architecture:
There is one Microfrontend (MFE) which should be integrated in two different shells (Shell 1 & Shell 2).
Each Shell for itself can consist out of only the MFE or several other components.
Each Shell and the MFE itself can have access to individual REST-APIs which secured with an Access-Token
Authorization
Shell 1 and Shell 2 are secured via an Authorization through Keycloak Identify Provider.
If User access Shell 1 or Shell 2 and does not have a valid access token, it is redirected to a login-page. After successful login the User gets redirected to the Shell Application.
Problem
The Microfrontend (MFE) itself needs to be secured also via an separate Access-Token, which will be used then for the communication towards the REST-API. At the moment when integrating the Microfrontend into the Shell an "Authorization Issue" occurs because the Shell Token which is used is not valid for the Microfrontend.
Question
What options are possible to achieve following:
- User A logins to Shell A with User Token for Shell A
- For Shell A the Mircofrontend will be integrated (Shell integrates / calls the Mircofrontend with the relevant Mircofrontend Token) and can use the Microfrontend.
- If User B calls Mircofrontend directly he needs to authorize via an individual Mircofrontend User Token.
- If User C calls Shell B and logs in with User Token for Shell B, similar behaviour then for Shell A
Additional Information
Shells and Microfrontend are implemented in Angular using Angular Module Federation.
As Identity Provider Keycloak is used without Token-Exchange.