Class: OmniAuth::Swagger::OAuth2Definition
- Inherits:
-
Object
- Object
- OmniAuth::Swagger::OAuth2Definition
- Defined in:
- lib/omniauth/swagger/oauth2_definition.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_options ⇒ Object
readonly
Returns the value of attribute client_options.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
Instance Method Summary collapse
- #authorize_params ⇒ Object
-
#initialize(security_def, options) ⇒ OAuth2Definition
constructor
A new instance of OAuth2Definition.
- #load_options(options) ⇒ Object
- #oauth2_key ⇒ Object
- #scopes ⇒ Object
Constructor Details
#initialize(security_def, options) ⇒ OAuth2Definition
Returns a new instance of OAuth2Definition.
8 9 10 |
# File 'lib/omniauth/swagger/oauth2_definition.rb', line 8 def initialize(security_def, ) @security_def, @options = security_def, end |
Instance Attribute Details
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
6 7 8 |
# File 'lib/omniauth/swagger/oauth2_definition.rb', line 6 def client_id @client_id end |
#client_options ⇒ Object (readonly)
Returns the value of attribute client_options.
6 7 8 |
# File 'lib/omniauth/swagger/oauth2_definition.rb', line 6 def @client_options end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
6 7 8 |
# File 'lib/omniauth/swagger/oauth2_definition.rb', line 6 def client_secret @client_secret end |
Instance Method Details
#authorize_params ⇒ Object
28 29 30 |
# File 'lib/omniauth/swagger/oauth2_definition.rb', line 28 def @security_def.extensions[:authorize_parameters] end |
#load_options(options) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/omniauth/swagger/oauth2_definition.rb', line 12 def () [:client_id] = @options[:client_id] [:client_secret] = @options[:client_secret] [:client_options][:authorize_url] = @security_def. [:client_options][:token_url] = @security_def.token_url [:scope] = @options[:scope] end |
#oauth2_key ⇒ Object
20 21 22 |
# File 'lib/omniauth/swagger/oauth2_definition.rb', line 20 def oauth2_key @security_def.id.to_sym end |
#scopes ⇒ Object
24 25 26 |
# File 'lib/omniauth/swagger/oauth2_definition.rb', line 24 def scopes @security_def.scopes ? @security_def.scopes.keys : [] end |