Skip to content

Commit

Permalink
feat(messaging): single tenant option (#615)
Browse files Browse the repository at this point in the history
* feat(messaging): single tenant option

* build messaging

* build bin

* sqlite

* revert

* Update packages/channels/src/teams/stream.ts

Co-authored-by: Francois-Xavier P. Darveau <955524+EFF@users.noreply.github.com>

* fix prettier

---------

Co-authored-by: allardy <yann.allard1@gmail.com>
Co-authored-by: David Vitor Antonio <david.vitora@gmail.com>
Co-authored-by: Francois-Xavier P. Darveau <955524+EFF@users.noreply.github.com>
  • Loading branch information
4 people committed Sep 12, 2023
1 parent 1e18a83 commit c480db0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/channels/src/teams/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { ChannelConfig } from '../base/config'
export interface TeamsConfig extends ChannelConfig {
appId: string
appPassword: string
tenantId: string
}

export const TeamsConfigSchema = {
appId: Joi.string().required(),
appPassword: Joi.string().required()
appPassword: Joi.string().required(),
tenantId: Joi.string().optional()
}
4 changes: 3 additions & 1 deletion packages/channels/src/teams/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ export class TeamsStream extends ChannelStream<TeamsService, TeamsContext> {
grant_type: 'client_credentials',
client_id: config.appId,
client_secret: config.appPassword,
tenant_id: config.tenantId,
scope: 'https://api.botframework.com/.default'
})
await axios.post('https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token', params.toString())
const tenant = config.tenantId ?? 'botframework.com'
await axios.post(`https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token`, params.toString())
} catch (e) {
throw new ChannelTestError(
'unable to reach teams using the provided app id and app password combination',
Expand Down

0 comments on commit c480db0

Please sign in to comment.