"Create Team" in "Microsoft Teams Scope" "Only loopback redirect" error

I’m trying the ¿new? UiPath.MicrosoftTeams.Activities.Office365TeamsApplicationScopeV2 (for God’s sake, ¿can you simplify/rationalize the naming of your activities/packages? It’s a nightmare to identify the proper ones amongst the maremagnum of packages with different/old/new/v2/v1/“classic”/“modem”/overlapping functionality/similar ones/deprecated/deleted/obsoleted/experimental/preview etc. versions) because I was suggested to try it by a third-party support company, even if it’s still in “preview” versions.

Well, when trying to authenticate via InteractiveToken, then use the “Create Team” activity, I always get this error:

"Create Team: Only loopback redirect uri is supported, but urn:ietf:wg:oauth:2.0:oob was found. Configure http://localhost or http://localhost:port both during app registration and when you create the PublicClientApplication object. See https://aka.ms/msal-net-os-browser for details"

Captura de pantalla 2023-12-28 100742

I’ve set up everything I’ve been able to think of in my Azure settings, plus explicitly setting the “redirect URI” to localhost. Whatever referenes I get when Googling for this error don’t help and are not related to UiPath, so I think this might be a bug with the activity itself.

Apart from “http://localhost”, I also added “urn:ietf:wg:oauth:2.0:oob was found” as a redirect, as per this documentation page:

Marketplace - Setup (uipath.com)

Refer following document Marketplace - Create Team

What makes you think that I didn’t prior to post anything in the forum?

Can you try to leave Tenant property empty?

If you select this option, the Username,Password, and Tenant properties should be left empty.

(Source: Marketplace - Microsoft Teams Scope)

Thank you @efelantti and @Mohan_Reddy ,

Certainly leaving the “Tenant” property empty made a difference, but now I’m getting the following error:

"Create Team: Could not create a graph client: "

I have a bunch of API permissions set for my app in the Azure portal panel, and the message above doesn’t give much information.

Any other hints?

Oh well,

I further investigated the error and I could see the full exception message:

“RemoteException wrapping UiPath.MicrosoftTeams.Office365Exception: Could not create a graph client: —> RemoteException wrapping Microsoft.Identity.Client.MsalServiceException: AADSTS700016: Application with identifier ‘XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX’ was not found in the directory ‘XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX’. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.”

Yeah; of course, that’s because my application is not in the default tenant.

I assumed that, maybe, the activity would have its own way to find where the App ID belonged to even if it wasn’t specified, but that’s not the case

Which leads me to conclude that the activity is (oh! how strange!) buggy, and the

“If you select this option, the Username ,Password , and Tenant properties should be left empty.”

line in the documentation is wrong, useless and misleading, because you need a way to tell UiPath to which tenant your application belongs to.

(By the way, documentation dudes, check the spelling and formatting)

So, after 3 months of losing time and effort, there’s still no way for our organization to accomplish the create-delete-manage Microsoft Teams teams in non-legacy Windows projectes, something we already accomplished in the phased-out Windows legacy projects.

Specifying the Tenant ID leads to this error:

RemoteException wrapping Microsoft.Graph.ServiceException: Code: Unauthorized
Message: UnknownError
Inner error:
AdditionalData:
date: 2023-12-29T11:09:45
request-id: b5b7c847-a490-46a2-ac04-573f795326df
client-request-id: b5b7c847-a490-46a2-ac04-573f795326df
ClientRequestId: b5b7c847-a490-46a2-ac04-573f795326df