MSAL vs. Microsoft Teams

%3CLINGO-SUB%20id%3D%22lingo-sub-920836%22%20slang%3D%22en-US%22%3EMSAL%20vs.%20Microsoft%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-920836%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20ADAL%20hasn't%20been%20touched%20in%20over%20two%20years%20now%2C%20I%20have%20migrated%20my%20application%20to%20MSAL.%20Sadly%20enough%20the%20Teams%20docs%20are%20still%20ADAL%20based.%20I%20have%20an%20application%20that%20is%20working%20fine%20outside%20Microsoft%20Teams.%20Once%20I%20embed%20it%20as%20an%20app%20inside%20Microsoft%20Teams%2C%20two%20things%20happen%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3EMSAL's%20acquireTokenSilent%20method%2C%20which%20returns%20a%20promise%2C%20fails%20silently%20without%20any%20possibility%20to%20know%20what%20happened.%20This%20has%20been%20raised%20before%2C%20many%20times%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FOfficeDev%2FTrainingContent%2Fissues%2F606%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ENot%20receiving%20the%20token%20response%20from%20MSAL%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzureAD%2Fmicrosoft-authentication-library-for-js%2Fissues%2F222%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAcquire%20a%20token%20silently%20from%20the%20MS%20Teams%20Iframe%20%23222%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzureAD%2Fmicrosoft-authentication-library-for-js%2Fissues%2F470%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EacquireTokenSilent%20not%20working%20inside%20Teams%20app%3F%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3CLI%3EI%20tried%20to%20enable%20MSAL's%20debug%20logging%20info.%20Working%20fine%20stand-alone%3B%20inside%20Teams%3A%20not%20one%20log%20message.%3C%2FLI%3E%3C%2FUL%3E%3CP%3EThere%20seems%20to%20have%20been%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FOfficeDev%2FTrainingContent%2Fblob%2Fmaster%2FTeams%2F04%2520Fundamentals%2520of%2520Microsoft%2520Teams%2FLab.md%23exercise3%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ea%20lab%20demo%3C%2FA%3E%20with%20MSAL's%20acquireTokenSilent%20in%20it%2C%20but%20that%20probably%20worked%20because%20it%20was%20launched%20from%20the%20config%20screen%20(or%20elsewhere)%20and%20not%20from%20the%20tab.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20on%20what%20location%20would%20acquireTokenSilent%20work%3F%20Should%20we%20move%20it%20to%20such%20an%20authentication%20popup%20to%20get%20it%20to%20work%20(far%20less%20silent%20though).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-920836%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAuthentication%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMSAL%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-942997%22%20slang%3D%22en-US%22%3ERe%3A%20MSAL%20vs.%20Microsoft%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-942997%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F405102%22%20target%3D%22_blank%22%3E%40salvijansen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMSAL%20doesn%E2%80%99t%20yet%20support%20the%20ability%20to%20authenticate%20in%20an%20iframed%20environment%2C%20which%20is%20how%20Teams%20tabs%20work.%20That%E2%80%99s%20why%20all%20of%20our%20examples%20use%20AAD%20v1%20and%20ADAL.%20We%20have%20been%20working%20with%20the%20MSAL%20team%20to%20fix%20this%20though%2C%20but%20we%20do%20not%20have%20a%20firm%20ETA%20to%20share.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1069922%22%20slang%3D%22en-US%22%3ERe%3A%20MSAL%20vs.%20Microsoft%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1069922%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F359599%22%20target%3D%22_blank%22%3E%40Gousia_Begum%3C%2FA%3E%26nbsp%3B%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F405102%22%20target%3D%22_blank%22%3E%40salvijansen%3C%2FA%3E%26nbsp%3Bwith%20the%20new%20MSAL%201.2.0%20release%20it%20seems%20like%20Teams%20is%20now%20supported%20have%20any%20of%20you%20verified%20it%20or%20plan%20to%20in%20near%20future%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1244122%22%20slang%3D%22en-US%22%3ERe%3A%20MSAL%20vs.%20Microsoft%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1244122%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F359599%22%20target%3D%22_blank%22%3E%40Gousia_Begum%3C%2FA%3E%26nbsp%3BHi.%20just%20wanted%20to%20check%20in%20to%20see%20if%20anything%20recently%20changed.%20I%20am%20having%20some%20issues%20making%20ADAL%20work%20within%20a%20Teams%20Tab%20and%20most%20replies%20to%20issues%20I've%20seen%20are%20to%20use%20MSAL.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

As ADAL hasn't been touched in over two years now, I have migrated my application to MSAL. Sadly enough the Teams docs are still ADAL based. I have an application that is working fine outside Microsoft Teams. Once I embed it as an app inside Microsoft Teams, two things happen:

 

There seems to have been a lab demo with MSAL's acquireTokenSilent in it, but that probably worked because it was launched from the config screen (or elsewhere) and not from the tab.

 

So on what location would acquireTokenSilent work? Should we move it to such an authentication popup to get it to work (far less silent though).

 

 

3 Replies

@salvijansen 

MSAL doesn’t yet support the ability to authenticate in an iframed environment, which is how Teams tabs work. That’s why all of our examples use AAD v1 and ADAL. We have been working with the MSAL team to fix this though, but we do not have a firm ETA to share.

 

@Gousia_Begum , @salvijansen with the new MSAL 1.2.0 release it seems like Teams is now supported have any of you verified it or plan to in near future?

@Gousia_Begum Hi. just wanted to check in to see if anything recently changed. I am having some issues making ADAL work within a Teams Tab and most replies to issues I've seen are to use MSAL.

 

thanks