Trouble with oauth and MS Teams, team creation

Mike Hashemi
Mega Sage

I am working with a customer and have a problem creating Teams using the Microsoft Teams Graph Spoke.

 

There is an app registration in Entra (permissions in the attached screenshot). I asked the Entra admin to log into ServiceNow and click the “Get OAuth Token” on the [oauth_2_0_credentials] record, which he did (authenticating with his own Entra account).

 

When I created a [pm_project] record and clicked the UI Action to create a team, the Create Team action failed with, “Error: Access Denied, you are not the owner of the group you are trying to access.”. The out-of-box UI Action attempts to add the user referenced in field project_manager field as the team owner. When I hard-coded the Entra admin’s object ID into the UI Action’s “owners” array and re-submitted the request, the team was created with both the Entra admin and project manager as owners.

 

The Entra admin does not want to be included in the ownership list of teams. While troubleshooting, he manually generated a bearer token from the client ID and secret used in the Oauth application registration and I manually added it as an authorization header in a copy of the Create Team action. When executed using the authorization header, I was able to create the team with only the PM listed as an owner.

 

My question is, what change(s) is(are) required to get ServiceNow to use the out-of-box oauth authentication, but not require the user that created the oauth token to be an owner of the resulting team?

0 REPLIES 0