Module: Legion::Extensions::MicrosoftTeams::Runners::Auth
- Includes:
- Helpers::Lex, Helpers::Client
- Included in:
- Client
- Defined in:
- lib/legion/extensions/microsoft_teams/runners/auth.rb
Instance Method Summary
collapse
#bot_connection, #graph_connection, #oauth_connection, #user_path
Instance Method Details
#acquire_bot_token(client_id:, client_secret:, scope: 'https://api.botframework.com/.default') ⇒ Object
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/legion/extensions/microsoft_teams/runners/auth.rb', line 25
def acquire_bot_token(client_id:, client_secret:,
scope: 'https://api.botframework.com/.default', **)
response = oauth_connection(tenant_id: 'botframework.com').post('oauth2/v2.0/token', {
grant_type: 'client_credentials',
client_id: client_id,
client_secret: client_secret,
scope: scope
})
{ result: response.body }
end
|
#acquire_token(tenant_id:, client_id:, client_secret:, scope: 'https://graph.microsoft.com/.default') ⇒ Object
15
16
17
18
19
20
21
22
23
|
# File 'lib/legion/extensions/microsoft_teams/runners/auth.rb', line 15
def acquire_token(tenant_id:, client_id:, client_secret:, scope: 'https://graph.microsoft.com/.default', **)
response = oauth_connection(tenant_id: tenant_id).post('oauth2/v2.0/token', {
grant_type: 'client_credentials',
client_id: client_id,
client_secret: client_secret,
scope: scope
})
{ result: response.body }
end
|