-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import React from "react"; | ||
| import { GithubOutlined, WindowsOutlined } from "@ant-design/icons"; | ||
|
|
||
| export interface AuthProviderInfo { | ||
| name: string; | ||
| displayName: string; | ||
| icon: React.ReactNode; | ||
| color: string; | ||
| connectingText: string; | ||
| buttonText: string; | ||
| } | ||
|
|
||
| export const getAuthProviderInfo = (authType: string): AuthProviderInfo => { | ||
| switch (authType) { | ||
| case "github": | ||
| return { | ||
| name: "github", | ||
| displayName: "GitHub", | ||
| icon: <GithubOutlined />, | ||
| color: "#24292f", | ||
| connectingText: "Connecting to GitHub...", | ||
| buttonText: "Sign in with GitHub", | ||
| }; | ||
|
|
||
| case "msal": | ||
| return { | ||
| name: "msal", | ||
| displayName: "Microsoft", | ||
| icon: <WindowsOutlined />, | ||
| color: "#0078d4", | ||
| connectingText: "Connecting to Microsoft...", | ||
| buttonText: "Sign in with Microsoft", | ||
| }; | ||
|
|
||
| default: | ||
| return { | ||
| name: "unknown", | ||
| displayName: "External Provider", | ||
| icon: <GithubOutlined />, // fallback icon | ||
|
||
| color: "#1890ff", | ||
| connectingText: "Connecting...", | ||
| buttonText: "Sign in", | ||
| }; | ||
| } | ||
| }; | ||
|
|
||
| export const getPopupWindowName = (authType: string): string => { | ||
| return `${authType}-auth`; | ||
| }; | ||
|
|
||
| export const isAuthEnabled = (authType: string): boolean => { | ||
| return authType !== "none"; | ||
| }; | ||
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
autogen/python/packages/autogen-studio/autogenstudio/web/auth/providers.py
Line 143 in 7eecd95
To fix it, I think we need a separate PR.