Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ const fetchA2AAuthKey = async (siteResourceId: string, workflowName: string, isD
// Helper function to fetch EasyAuth
const fetchAuthentication = async (siteResourceId: string) => {
try {
const response = await axios.post(`${baseUrl}${siteResourceId}/config/authsettings/list?api-version=${standardApiVersion}`, {
const response = await axios.post(`${baseUrl}${siteResourceId}/config/authsettings/list?api-version=${standardApiVersion}`, null, {
headers: {
Authorization: `Bearer ${environment.armToken}`,
},
Expand Down Expand Up @@ -445,7 +445,7 @@ export const fetchAgentUrl = (siteResourceId: string, workflowName: string, host
queryParams = { apiKey: a2aKey };

// Add OBO token if available
const oboKey = oboData?.properties?.key;
const oboKey = oboData?.properties?.key || oboData?.key;
if (oboKey) {
queryParams.oboUserToken = oboKey;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const AgentUrlViewer: React.FC<AgentUrlViewerProps> = ({ url, isOpen, que
}

const queryString = new URLSearchParams(definedParams).toString();
return queryString ? `${url}?${queryString}` : url;
return queryString ? `${url}${url.includes('?') ? '&' : '?'}${queryString}` : url;
}, [url, queryParams]);

const handleOpenInNewTab = () => {
Expand Down
29 changes: 27 additions & 2 deletions libs/designer-v2/src/lib/ui/FloatingRunButton/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,43 @@ export const ChatButton = (props: ChatButtonProps) => {
if (isLoading || isSaving) {
return <Spinner size="medium" label={IntlText.LOADING} />;
}
const queryParams = new URLSearchParams();

if (data?.queryParams?.apiKey) {
queryParams.set('apiKey', data.queryParams.apiKey);
}

if (data?.queryParams?.oboUserToken) {
queryParams.set('oboUserToken', data.queryParams.oboUserToken);
}

if (isDarkMode) {
queryParams.set('mode', 'dark');
}

const separator = agentChatUrl?.includes('?') ? '&' : '?';
const src = queryParams.toString() ? `${agentChatUrl}${separator}${queryParams.toString()}` : agentChatUrl;

return (
<iframe
src={`${agentChatUrl}${agentChatUrl?.includes('?') ? '&' : '?'}apiKey=${data?.queryParams?.apiKey}${isDarkMode ? '&mode=dark' : ''}`}
src={src}
title={IntlText.TITLE}
sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-modals allow-top-navigation-by-user-activation allow-storage-access-by-user-activation"
referrerPolicy="strict-origin-when-cross-origin"
loading="eager"
style={{ width: '100%', height: '99%', border: 'none', borderRadius: tokens.borderRadiusXLarge }}
/>
);
}, [isLoading, isSaving, agentChatUrl, data?.queryParams?.apiKey, isDarkMode, IntlText.TITLE, IntlText.LOADING]);
}, [
isLoading,
isSaving,
agentChatUrl,
data?.queryParams?.apiKey,
data?.queryParams?.oboUserToken,
isDarkMode,
IntlText.TITLE,
IntlText.LOADING,
]);

return (
<>
Expand Down
Loading