microsoft-graph-toolkit
microsoft-graph-toolkit copied to clipboard
Support single tenant AAD application for Teams MSAL2 Provider
Hi, team, Now Teams MSAL2 provider only support multi-tenant AAD application according to these docs:
https://docs.microsoft.com/en-us/graph/toolkit/providers/teams-msal2?tabs=ts#creating-an-appclient-id
https://docs.microsoft.com/en-us/graph/toolkit/get-started/build-a-microsoft-teams-sso-tab?tabs=unpkg%2CHTML#creating-an-appclient-id
In some scenario, we can only use single tenant AAD application, which has different authority and not compatible with multi-tenant AAD application.
Do we have plan to support it? Thank you very much!
Hello SLdragon, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
Hey @SLdragon, have you tried specifying the tenant in the authority property in the config object? This should allow you to use the provider with a single tenant application.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
Thanks for your feedback, however from TeamsMsal2Config
, I didn't find authority property, where can I find it?
export interface TeamsMsal2Config {
clientId: string;
authPopupUrl: string; // see below for creating the popup page
scopes?: string[];
msalOptions?: Configuration;
ssoUrl?: string; // ex: '/api/token',
autoConsent?: boolean,
httpMethod: HttpMethod; //ex HttpMethod.POST
}
I see. One way to do it is to add the authority as part of the msalOptions
configuration, but I know that is probably not the most ergonomic approach.
Do you want to help us add an authority
property to the TeamsMsal2Config object to make this a bit easier?
Oh, yes, that will be great if you have authority property in the TeamsMsal2Config object, thank you! I am not very familiar with your code, and where can I start?
Helping with this one for you @SLdragon. The best place to start would be here : https://github.com/microsoftgraph/microsoft-graph-toolkit/blob/main/packages/providers/mgt-teams-msal2-provider/src/TeamsMsal2Provider.ts#L94
If defined, it could be merged with the MSAL Config here : https://github.com/microsoftgraph/microsoft-graph-toolkit/blob/main/packages/providers/mgt-teams-msal2-provider/src/TeamsMsal2Provider.ts#L305
That would be absolutely useful, especially in TeamsFx scenarios! Please let us know! Something similar could be achieved also for the TeamsFx provider!
Closing this at the TeamsMSAL2 provider is deprecated