Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks module in MS Teams V2 unable to view SharePoint document #2413

Open
tanimcseku opened this issue Jul 18, 2024 · 4 comments
Open

Tasks module in MS Teams V2 unable to view SharePoint document #2413

tanimcseku opened this issue Jul 18, 2024 · 4 comments

Comments

@tanimcseku
Copy link

Hi everyone,

I am facing an issue similar to #2340. To be more specific for my case, I have a feature where I am using the tasks module to open a SharePoint document. But since opening a SharePoint document through tasks module i.e. inside iFrame needs separate authentication. But login.microsoftonline.com is blocked loading inside an tasks module (iFrame) for the security reason. To solve that, I was using authentication module through below steps.

  • Used the microsoftTeams.authentication.authenticate method to authenticate the user and get the necessary tokens.
  • Created a new HTML file (simple-start-v2.html) to handle the redirection to the authorization endpoint. This file will be loaded in the pop-up window and this html will be invoked by the tasks module.
  • Created a new HTML file (simple-end.html) to handle the OAuth callback and process the tokens. This page will be loaded after the user authenticates and will pass the tokens back to the Teams app.
  • Once authentication completed I was opening the SharePoint document through location redirect.

Above flow was working fine in MS Teams Classis/V1 version. But once I moved to Teams V2, that flow is not working anymore. It's mainly failing in the last step i.e. when opening the SharePoint document after auth flow in first 3 steps.

Regards,
M Fazlul Karim

@tanimcseku tanimcseku changed the title Tasks module in MS Teams V2 unable to SharePoint document Tasks module in MS Teams V2 unable to view SharePoint document Jul 18, 2024
@Dinesh-MSFT
Copy link

Dinesh-MSFT commented Jul 18, 2024

Hi @tanimcseku - Thanks for raising the query.
We will look into it and let you know the updates.

Update: We understand that the authentication flow that worked in the MS Teams V1 is not functioning as expected in V2, particularly when redirecting to open a SharePoint document.

We are aware of similar issues, we raised bug and actively working on a resolution. In the meantime, could you please confirm if you have followed the updated guidance for authentication and task modules in MS Teams V2? Additionally, please ensure that the URLs used in the task module are correctly formatted and that the domains are included in the validDomains list in your app manifest.

If the issue persists, could you provide us with the following information to assist you further:

  1. The exact error message or behavior you are encountering after the authentication flow.
  2. Any relevant screenshots or logs that could help us diagnose the problem.

@tanimcseku
Copy link
Author

Hi @Dinesh-MSFT ,

In the meantime, could you please confirm if you have followed the updated guidance for authentication and task modules in MS Teams V2?

Thanks for your response. FYI, I haven't made any implementation changes for V2 yet. The same auth flow that I discussed above was or still working fine in classic teams but not in teams v2. I reported that issue just after encountering this without making any kind of implementation changes. Same for the URLs used.

  1. The exact error message or behavior you are encountering after the authentication flow.

The auth flow seems working properly but as I said, once the auth flow completed with a success callback then I am trying to load the SharePoint doc URL inside the tasks module. And there is no prompt error. The only issue I am finding is when I am debugging tasks module window using engineering tools then I can a CORS error which happened when loading the SharePoint URL as blocking of loading login.microsoftonline.com and the tasks module is remaining blank.

  1. Any relevant screenshots or logs that could help us diagnose the problem.

So the screenshot will be just a console error of blocked loading login.microsoftonline.com inside tasks modal. Sorry cannot share any screenshot now

@tanimcseku
Copy link
Author

Hi @Dinesh-MSFT , below is the screenshot as you requested,

image

@tanimcseku
Copy link
Author

Hi @Dinesh-MSFT , may I get your support on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants