Class: BotFramework::TokenValidator

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/bot_framework/token_validator.rb

Constant Summary collapse

OPEN_ID_CONFIG_URI =
'https://api.aps.skype.com/v1/.well-known/openidconfiguration'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers) ⇒ TokenValidator

Returns a new instance of TokenValidator.



8
9
10
# File 'lib/bot_framework/token_validator.rb', line 8

def initialize(headers)
  @headers = headers
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



4
5
6
# File 'lib/bot_framework/token_validator.rb', line 4

def errors
  @errors
end

#headersObject

Returns the value of attribute headers.



4
5
6
# File 'lib/bot_framework/token_validator.rb', line 4

def headers
  @headers
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
18
19
# File 'lib/bot_framework/token_validator.rb', line 12

def valid?
  valid_header? &&
    valid_jwt? &&
    valid_iss? &&
    valid_audience? &&
    valid_token? &&
    valid_signature?
end