Run this first to get all the config files:
teams config add atk.oauth
Then run via ATK.
Use this if you want to enable user authentication in your Teams application.
-
In the
aad.manifest.jsonfile, update therequiredResourceAccesslist to add the required scopes. -
In the
infra/botRegistration/azurebot.bicepfile, under thebotServicesMicrosoftGraphConnectionresource, update theproperties.scopesstring to be a comma-delimited list of the required scopes.
If you want to add the People.Read.All and User.ReadBasic.All scopes.
- Your
requiredResourceAccessproperty should look like:
"requiredResourceAccess": [
{
"resourceAppId": "Microsoft Graph",
"resourceAccess": [
{
"id": "People.Read.All",
"type": "Scope"
}
]
},
{
"resourceAppId": "Microsoft Graph",
"resourceAccess": [
{
"id": "User.ReadBasic.All",
"type": "Scope"
}
]
},
]- Update the
properties.scopesto bePeople.Read.All,User.ReadBasic.All.
NOTE: This example uses west europe, but follow the equivalent for other locations.
- In
azurebot.bicep, replace allglobaloccurrences towesteurope - In
manifest.json, invalidDomains,*.botframework.comshould be replaced byeurope.token.botframework.com - In
aad.manifest.json, replacehttps://token.botframework.com/.auth/web/redirectwithhttps://europe.token.botframework.com/.auth/web/redirect - In
index.ts, updateAppOptionsto includeapiClientSettings
const app = new App({
oauth: {
defaultConnectionName: 'graph',
},
logger: new ConsoleLogger('@examples/auth', { level: 'debug' }),
apiClientSettings: {
oauthUrl: "https://europe.token.botframework.com",
}
});