Skip to content

Commit

Permalink
Merge pull request #11721 from OfficeDev/hui/teams-url
Browse files Browse the repository at this point in the history
fix: launch the api ME with AAD auth template using manifest
  • Loading branch information
MSFT-yiz committed May 29, 2024
2 parents d3dc9bc + 57ba922 commit 393ca45
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/fx-core/src/common/m365/launchHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ export class LaunchHelper {
let installAppPackage = true;
if (
capabilities.length > 0 &&
capabilities.filter((capability) => !copilotCapabilities.includes(capability)).length == 0
(capabilities.filter((capability) => !copilotCapabilities.includes(capability)).length ==
0 ||
(!capabilities.includes("staticTab") &&
!capabilities.includes("Bot") &&
!capabilities.includes("configurableTab") &&
capabilities.includes("apiMeAAD")))
) {
installAppPackage = false;
}
Expand Down
9 changes: 9 additions & 0 deletions packages/manifest/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ export class ManifestUtil {
if (manifest.composeExtensions && manifest.composeExtensions.length > 0) {
capabilities.push("MessageExtension");
}
if (
manifest.composeExtensions &&
manifest.composeExtensions.length > 0 &&
(manifest.composeExtensions[0] as IComposeExtension).composeExtensionType == "apiBased" &&
(manifest.composeExtensions[0] as IComposeExtension).authorization?.authType ==
"microsoftEntra"
) {
capabilities.push("apiMeAAD");
}

const properties: ManifestCommonProperties = {
id: manifest.id,
Expand Down
23 changes: 23 additions & 0 deletions packages/manifest/src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ export interface IComposeExtension {
* To support SME, it's the relative path to api spec file in the manifest
*/
apiSpecificationFile?: string;

/**
* Authorization information.
*/
authorization?: IAuthorization;
}

export interface IComposeExtensionMessageHandler {
Expand Down Expand Up @@ -271,6 +276,24 @@ export interface IMessagingExtensionCommand {
apiResponseRenderingTemplateFile?: string;
}

export interface IAuthorization {
/**
* The type of authorization to use.
*/
authType?: "none" | "apiSecretServiceAuth" | "microsoftEntra";
/**
* Capturing details needed to do microsoftEntra auth flow. It will be only present when auth type is microsoftEntra.
*/
microsoftEntraConfiguration?: IMicrosoftEntraConfiguration;
}

export interface IMicrosoftEntraConfiguration {
/**
* Boolean indicating whether single sign on is configured for the app.
*/
supportsSingleSignOn?: boolean;
}

export interface IParameter {
/**
* Name of the parameter.
Expand Down

0 comments on commit 393ca45

Please sign in to comment.