How azure-samples/js-e2e-web-app-easy-auth-app-to-app works
Main Components
• Frontend App Service: Represent the frontend folder which contains the Express.js application with view templates, error handling logic (error.js), and modules for managing refresh tokens and remote profile access.
• Backend App Service: Represent the backend folder, which includes core Express.js server files (server.js and index.js), modules for sorting JSON data (sortJson.js), authentication modules, and graph-related commands for securing service-to-service calls.
• External Services / Endpoints: Optionally include external endpoints such as the token issuance flow, service-to-service token exchange, and any remote APIs requested on behalf of the signed-in user.
Relationships and Interactions
• Backend to Azure AD: If applicable, highlight that the backend verifies access tokens or may call out to AAD for token validation and additional user details.
Architectural Patterns and Design Principles
• Separation of Concerns: Emphasize the clear split between the frontend and backend systems.
• Security and Token Management: Note the implementation of access token flows for both client-side and server-side operations.
• Modular Design: Indicate that helper functions (such as sortJson.js in both folders) are reused to keep the components lightweight and not monolithic.
Relevant Technologies, Frameworks, or Libraries
• Express.js: Both in frontend and backend for handling HTTP requests.
• EJS Templates: In the frontend for rendering dynamic pages.
• Azure App Service: Hosting platform with built-in support for authentication/authorization.
• Azure Active Directory: As the identity provider.
• Node.js: Underlying runtime mentioned indirectly by package.json files and JavaScript usage.
• Additional Scripts: Note how shell scripts (access-token.sh, app-creation.sh) support deployment or configuration tasks.