-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Added MSALAuthProvider. #7010
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
base: main
Are you sure you want to change the base?
Added MSALAuthProvider. #7010
Conversation
@victordibia @gagb Could you help take a look? Thank you. |
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 Microsoft Azure Active Directory authentication support to AutoGen Studio using the Microsoft Authentication Library (MSAL), enabling users to authenticate with their Microsoft/Azure accounts alongside the existing GitHub authentication.
- Integrates MSAL authentication provider with OAuth 2.0 flow for Microsoft identity platform
- Updates frontend login UI to dynamically support multiple authentication providers
- Adds provider-specific configuration handling for MSAL credentials and settings
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
pyproject.toml | Adds msal dependency for Microsoft authentication support |
frontend/src/pages/login.tsx | Updates login page to dynamically display provider-specific UI elements |
frontend/src/auth/utils.tsx | New utility file providing provider-specific UI configuration and helper functions |
frontend/src/auth/context.tsx | Updates auth context to use provider-specific messaging |
autogenstudio/web/auth/providers.py | Implements MSALAuthProvider with complete OAuth flow and user profile extraction |
autogenstudio/web/auth/manager.py | Adds MSAL configuration loading from environment variables |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
"access_token": access_token, | ||
"id_token": result.get("id_token"), |
Copilot
AI
Sep 10, 2025
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.
Storing the access token in user metadata could pose a security risk if this data is logged, cached, or exposed through APIs. Consider whether the access token needs to be stored or if it should be handled more securely.
"access_token": access_token, | |
"id_token": result.get("id_token"), |
Copilot uses AI. Check for mistakes.
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.
It follows the same pattern as GithubAuthProvider. GithubAuthProvider also stores token in metadata.
"access_token": access_token, |
To fix it, I think we need a separate PR.
return { | ||
name: "unknown", | ||
displayName: "External Provider", | ||
icon: <GithubOutlined />, // fallback icon |
Copilot
AI
Sep 10, 2025
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.
Using GitHub icon as fallback for unknown auth providers is misleading. Consider using a generic authentication icon or a question mark icon instead.
Copilot uses AI. Check for mistakes.
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.
Changed from GithubOutlined
to LoginOutlined
which provides a generic authentication icon that's more appropriate for unknown providers.
@victordibia Addressed the comments. |
Why are these changes needed?
Summary
This PR adds Microsoft Azure Active Directory authentication support to AutoGen
Studio using the Microsoft Authentication Library (MSAL). Users can now authenticate
with their Microsoft/Azure accounts to access AutoGen Studio securely.
Changes Made
🔐 Backend Authentication Implementation
Added
MSALAuthProvider
inautogenstudio/web/auth/providers.py
Extended authentication models in
autogenstudio/web/auth/models.py
MSALAuthConfig
model for Azure app registration settingsAuthConfig
with MSAL validationexclude_paths
for authentication bypassEnhanced auth manager in
autogenstudio/web/auth/manager.py
🎨 Frontend Integration
Updated login page in
frontend/src/pages/login.tsx
Enhanced auth context in
frontend/src/auth/context.tsx
Added auth utilities in
frontend/src/auth/utils.tsx
(new file)To enable GitHub authentication, create a auth.yaml file in your app directory:
To pass in this configuration you can use the --auth-config argument when running the application:
Or set the environment variable:
chrome_KxwQFQXmH0.mp4
Related issue number
Checks