Module: LinkedIn::API::Authentication
- Included in:
- Client
- Defined in:
- lib/linkedin/api/authentication.rb
Instance Attribute Summary collapse
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #authorize_url(params = {}) ⇒ Object
- #request_access_token(authorization_code, params = {}) ⇒ Object
Instance Attribute Details
#state ⇒ Object (readonly)
Returns the value of attribute state.
4 5 6 |
# File 'lib/linkedin/api/authentication.rb', line 4 def state @state end |
Instance Method Details
#authorize_url(params = {}) ⇒ Object
6 7 8 9 10 |
# File 'lib/linkedin/api/authentication.rb', line 6 def (params = {}) params.reverse_merge! config.to_h.slice :scope, :state, :redirect_uri params[:scope] = serialize_scope params[:scope] auth_code. params end |
#request_access_token(authorization_code, params = {}) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/linkedin/api/authentication.rb', line 12 def request_access_token(, params = {}) raise Error::CSRF.new state, params[:state] if params[:state] && params[:state] != state params.reverse_merge! redirect_uri: config.redirect_uri opts = { mode: :query, param_name: 'oauth2_access_token' } self.access_token = auth_code.get_token , params, opts end |