Search code examples
azure-active-directorymicrosoft-graph-apimicrosoft-teamsmicrosoft-graph-teamspyjwt

Using python, Decode client side token fetched by microsoft teams and given to tab inside teams


I am trying to learn tab SSO. When Microsoft teams fetch token from AAD and pass it to tab, I want to send that token to my application server using ajax and decode it at server end.

I can see client side token successfully decoded by manually copy pasting in jwt.ms

Is there any python code that can be used to do the same done by jwt.ms? I tried this but getting the following error:

jwt.exceptions.InvalidAudienceError: Invalid audience

Solution

  • Your issue has been resolved. This is an error caused by an invalid audience you are using. You must change it to the correct audience: api://<webapp-domain>/<client_id>.

    This audience is actually the protected api that you expose in Azure.