Forum Discussion

jasonbrl's avatar
jasonbrl
Copper Contributor
Jul 08, 2022

AccessToken issue with Connect-MicrosoftTeams

Hi,

We're encountering this error when we do Connect-MicrosoftTeams using access tokens. 

 

Here's our scenario:

Given:

  • Guest user from another Azure tenant that's given admin permissions
  • App registration with secret and UPN optional claim.

Steps:

  1. Login to a tenant with the guest user. Were logging in using Azure React MSAL library.
  2. We're able to get a token with the UPN claim for this guest user. At this point we're storing the id_token which we submit to our backend where we get Graph and Teams tokens.
  3. Retrieve Graph and Teams tokens for Connect-MicrosoftTeams to use. Here are the parameters we used to get Graph token:
  4. Once we get the Graph and Teams token, then we use `Connect-MicrosoftTeams -AccessTokens (..)`. However this would return the error above.

We're not entirely sure but our guess was due to missing UPN claims from the Graph/Teams tokens. If we do the same steps above with a user from within our tenant, then it would complete properly. It only happens when we use a guest user with admin privileges. 

 

Any ideas or suggestions would be greatly appreciated!

 

Cheers,

Jason

 

 

8 Replies

Resources