I have a bot with Cortana channel added to it. I have configured Cortana connected account to get access token to Graph APIs. My bot code is using this token to call MS Teams APIs.
Cortana properly invokes my skill bot and prompts for user sign in. After a successful sign in, I have verified in the code that I am getting access token. Using this token, when my bot code makes a call to https://graph.microsoft.com/v1.0/me/joinedTeams
, I get the response:
{
StatusCode: 403,
ReasonPhrase: 'Forbidden',
Version: 1.1,
Content: System.Net.Http.StreamContent,
Headers: {
Transfer-Encoding: chunked
request-id: b1f83dda-1ce4-4660-9950-d890123f5b27
client-request-id: b1f83dda-1ce4-4660-9950-d890123f5b27
x-ms-ags-diagnostic: {
"ServerInfo":{
"DataCenter":"West US",
"Slice":"SliceC",
"Ring":"5",
"ScaleUnit":"003",
"Host":"AGSFE_IN_4",
"ADSiteName":"WUS"
}
}
Duration: 43.0296
Strict-Transport-Security: max-age=31536000
Cache-Control: private
Date: Wed, 23 Jan 2019 20:13:33 GMT
Content-Type: application/json
}
}
I have set following permissions in the scope of Cortana channel Oauth Settings as well as in-app in the Azure portal:
Mail.Read
Mail.Send
openid
profile
User.Read
User.ReadBasic.All
User.Read.All
User.ReadWrite.All
Group.Read.All
Group.ReadWrite.All
(Delegated + Application)
The same call through graph explorer with same sign in credentials returns me a list of my joined Teams.
What am I missing here? How do I debug this further?