Teams Custom App Authentication popup issue in teams web and desktop application.
Also on console i am getting error as - Refused to display 'https://login.microsoftonline.com/......' in a frame because it set 'X-Frame-Options' to 'deny'.
CodePudding user response:
Ensure that you adhere to the following prerequisites while building your Teams personal and channel or group tab:
Allow your tab pages to be discovered in an iFrame, using X-Frame-Options and Content-Security-Policy HTTP response headers.
Set header: Content-Security-Policy: frame-ancestors teams.microsoft.com *.teams.microsoft.com *.skype.com
For Internet Explorer 11 compatibility, set
X-Content-Security-Policy.Alternately, set header X-Frame-Options: ALLOW-FROM
https://teams.microsoft.com/. This header is deprecated but still
accepted by most browsers
Reference Doc: https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/tab-requirements
CodePudding user response:
Teams won't allow you to launch a popup because you are within a controlled environment - if you need to support an outside-of-Teams scenario as well, then you need to detect if you're being hosted inside Teams, and if not, you can launch your popup, but if you are, then launch the authentication command which launches Teams' own popup to handle this for you. Basically, follow along with the docs and you should be fine - here's a good starting point: https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/tab-sso-overview