Class: BotFramework::Connector
- Inherits:
-
Object
- Object
- BotFramework::Connector
- Defined in:
- lib/bot_framework/connector.rb
Overview
Connector class
Constant Summary collapse
- CONFIG_URI =
'https://api.aps.skype.com/v1/.well-known/openidconfiguration'.freeze
- REFRESH_ENDPOINT =
'https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token'.freeze
- REFRESH_SCOPE =
'https://api.botframework.com/.default'.freeze
- OPEN_ID_METADATA =
'https://login.botframework.com/v1/.well-known/openidconfiguration'.freeze
- BOT_CONNECTOR_ISSUER =
'https://api.botframework.com'.freeze
- MSA_OPEN_ID_METADATA =
'https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration'.freeze
- MSA_ISSUER =
'https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/'.freeze
- MSA_AUDIENCE =
'https://graph.microsoft.com'.freeze
- EMULATOR_AUDIENCE_METADATA =
'https://login.microsoftonline.com/botframework.com/v2.0/.well-known/openid-configuration'.freeze
- EMULATOR_AUDIENCE =
'https://sts.windows.net/d6d49420-f39b-4df7-a1dc-d59a935871db/'.freeze
- STATE_END_POINT =
'https://state'.freeze
Instance Attribute Summary collapse
-
#app_id ⇒ Object
include HTTParty.
-
#app_secret ⇒ Object
include HTTParty.
-
#token ⇒ Object
include HTTParty.
Instance Method Summary collapse
- #client ⇒ Object
- #get_token ⇒ Object
-
#initialize(options = {}) {|_self| ... } ⇒ Connector
constructor
A new instance of Connector.
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Connector
Returns a new instance of Connector.
18 19 20 21 22 |
# File 'lib/bot_framework/connector.rb', line 18 def initialize( = {}) @app_id = [:app_id] @app_secret = [:app_secret] yield(self) if block_given? end |
Instance Attribute Details
#app_id ⇒ Object
include HTTParty
5 6 7 |
# File 'lib/bot_framework/connector.rb', line 5 def app_id @app_id end |
#app_secret ⇒ Object
include HTTParty
5 6 7 |
# File 'lib/bot_framework/connector.rb', line 5 def app_secret @app_secret end |
#token ⇒ Object
include HTTParty
5 6 7 |
# File 'lib/bot_framework/connector.rb', line 5 def token @token end |
Instance Method Details
#client ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/bot_framework/connector.rb', line 24 def client OAuth2::Client.new(app_id, app_secret, authorize_url: 'botframework.com/oauth2/v2.0/authorize', token_url: 'botframework.com/oauth2/v2.0/token', raise_errors: true, site: 'https://login.microsoftonline.com') end |
#get_token ⇒ Object
38 39 40 |
# File 'lib/bot_framework/connector.rb', line 38 def get_token client.client_credentials.get_token(scope: 'https://api.botframework.com/.default', token_method: :post) end |