-
Notifications
You must be signed in to change notification settings - Fork 95
feat(iframe-app): Add dynamic authentication provider support for chat iframe app #8649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | Keep as-is. |
| Commit Type | ✅ | No change needed. |
| Risk Level | ✅ | Label matches body. |
| What & Why | ✅ | Add a brief "Breaking / Migration" note. |
| Impact of Change | Add explicit migration steps for developers. | |
| Test Plan | ✅ | Ensure CI job guidance included if needed. |
| Contributors | Optionally credit others (PM/Design/Reviewers). | |
| Screenshots/Videos | ✅ | Good — no change. |
Final notes and required actions
- Overall: PASS — the PR body and title comply with the template and are well-documented. The label and risk selection match the change footprint.
- Important recommendation (please include in PR body and CHANGELOG): this change modifies authentication APIs and types used by other parts of the codebase and consumers (notably openLoginPopup signature, checkAuthStatus return type, and ChatWidgetProps adding identityProviders). Please add a short "Breaking / Migration" section that lists the exact code changes consumers must make. Example items to include in that section:
- openLoginPopup: previously called as openLoginPopup({ baseUrl, ... }) — update to pass signInEndpoint when using non-AAD providers: openLoginPopup({ baseUrl, signInEndpoint: '/.auth/login/google', ... }).
- checkAuthStatus return: update code that awaited a boolean to now destructure { isAuthenticated, error }.
- ChatWidgetProps / exported types: update imports to include the new IdentityProvider type and to pass identityProviders where applicable.
- Security & review: Because this changes authentication flow and e2e mocks, please request a quick security review and run the auth-related end-to-end CI pipelines. Call out any environment variables/config required for Easy Auth provider testing in the PR or repository docs.
Please update the PR body with the migration note and any guidance for consumers, then re-submit or add a follow-up commit. Thank you for the thorough tests and clear description — this looks well-developed and ready pending the small documentation additions.
Last updated: Tue, 09 Dec 2025 20:25:52 GMT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds dynamic authentication provider support to the chat iframe application, replacing the hardcoded Azure AD authentication with a configurable system that supports multiple identity providers (Microsoft, Google, Facebook, GitHub) via Azure App Service Easy Auth. The changes include a new authentication status check on app initialization to skip login prompts for already-authenticated users, and a redesigned LoginPrompt component that displays multiple sign-in buttons when multiple providers are configured.
Key changes:
- New
IdentityProviderinterface and type exports across libs/a2a-core for provider configuration - Enhanced authentication flow with dynamic provider endpoints and auth status checking
- Updated LoginPrompt component with per-provider loading states and configuration messaging
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/a2a-core/src/react/types/index.ts | Added IdentityProvider to type exports and ChatWidgetProps interface |
| libs/a2a-core/src/react/index.ts | Exported IdentityProvider type from react module |
| libs/a2a-core/src/client/types.ts | Defined IdentityProvider interface with signInEndpoint and name properties |
| libs/a2a-core/src/client/index.ts | Exported IdentityProvider type from client module |
| apps/iframe-app/src/lib/utils/config-parser.ts | Added default identity providers configuration and window.IDENTITY_PROVIDERS support |
| apps/iframe-app/src/lib/utils/tests/config-parser.test.ts | Added tests for identity provider configuration parsing |
| apps/iframe-app/src/lib/utils/tests/config-parser.contextId.test.ts | Updated test to verify removed console.log statements |
| apps/iframe-app/src/lib/authHandler.ts | Added signInEndpoint parameter to openLoginPopup, updated login URL construction, removed verbose logging |
| apps/iframe-app/src/lib/tests/authHandler.test.ts | Updated tests to include signInEndpoint parameter and test multiple providers |
| apps/iframe-app/src/components/LoginPrompt/LoginPrompt.tsx | Redesigned to support multiple providers with individual loading states and configuration messaging |
| apps/iframe-app/src/components/LoginPrompt/LoginPromptStyles.ts | Updated styles for multi-provider layout with renamed messageBar class |
| apps/iframe-app/src/components/tests/LoginPrompt.spec.tsx | Comprehensive test updates for multi-provider support and edge cases |
| apps/iframe-app/src/components/IframeWrapper.tsx | Added authentication check on mount with loading state, updated login handler to accept provider |
| apps/iframe-app/src/components/tests/IframeWrapper.test.tsx | Mocked checkAuthStatus and updated tests to await auth check completion |
| apps/iframe-app/src/components/tests/IframeWrapper.contextId.test.tsx | Updated tests to mock auth check and handle async rendering |
| e2e/chatClient/tests/smoke/page-load.spec.ts | Added .auth/me mock to return authenticated user |
| e2e/chatClient/tests/smoke/basic-chat.spec.ts | Added .auth/me mock across all test suites |
| e2e/chatClient/tests/features/ui/edge-cases.spec.ts | Added .auth/me mock to bypass login prompts in tests |
| e2e/chatClient/tests/features/ui/accessibility.spec.ts | Added .auth/me mock for authenticated test scenarios |
| e2e/chatClient/tests/features/sessions/session-management.spec.ts | Added .auth/me mock to test authenticated session flows |
| e2e/chatClient/tests/features/sessions/multi-session.spec.ts | Added .auth/me mock across multi-session test suites |
| e2e/chatClient/tests/features/reliability/network-connectivity.spec.ts | Added .auth/me mock to focus tests on network reliability |
| e2e/chatClient/tests/features/reliability/error-handling.spec.ts | Added .auth/me mock to test error scenarios with authenticated users |
| e2e/chatClient/tests/features/messaging/input-validation.spec.ts | Added .auth/me mock for authenticated messaging tests |
| e2e/chatClient/tests/features/messaging/complete-flow.spec.ts | Added .auth/me mock to test complete chat flows |
| e2e/chatClient/tests/features/authentication/login-prompt.spec.ts | Updated all tests to use provider-specific button names (Microsoft account) |
| e2e/chatClient/fixtures/sse-fixtures.ts | Added .auth/me mock to SSE test fixtures for consistent authentication state |
hartra344
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review completed. The PR is well-structured with excellent test coverage.
Highlights:
- Good separation of concerns with auth logic in authHandler.ts
- Comprehensive unit tests covering auth flows and edge cases
- Clean TypeScript interfaces for IdentityProvider
Minor suggestions for future consideration:
- Consider clearing loadingProviderKeyRef when login completes to prevent stale UI
- Add cleanup/abort mechanism in auth check useEffect for race condition safety
Overall, solid implementation. ✅
Commit Type
Risk Level
What & Why
This PR adds support for dynamic authentication providers in the chat iframe application. Previously, the authentication was hardcoded to use Azure AD (Microsoft Entra ID). Now, the application can dynamically display and support multiple identity providers configured via Azure App Service Easy Auth (e.g., Microsoft, Google, Facebook, GitHub).
Key changes:
window.IDENTITY_PROVIDERSor fallback to default providersImpact of Change
Users:
Developers:
IdentityProviderinterface for defining authentication providersLoginPromptcomponent now acceptsidentityProviderspropopenLoginPopupnow requiressignInEndpointparametercheckAuthStatusfunction for checking authentication stateSystem:
/.auth/meendpoint on initialization to determine authentication statuswindow.IDENTITY_PROVIDERSor falls back to default providersTest Plan
LoginPromptcomponent tests to handle multiple providersauthHandlertests to includesignInEndpointparameterIframeWrappertests to mockcheckAuthStatusconfig-parsertests to verify identity provider configurationContributors
@ccastrotrejo
Screenshots/Videos
Multiple identity providers
No identity providers in logic app setup