Sha256: 1740b1d19667a760d45940ec8e4e03d2a6b7dcb9ebb070cdbece887bc4d5da42

Contents?: true

Size: 627 Bytes

Versions: 4

Compression:

Stored size: 627 Bytes

Contents

module LinkedIn
  module API
    module Authentication
      attr_reader :state

      def authorize_url(params={})
        params.reverse_merge! defaults(:scope, :state, :redirect_uri)
        auth_code.authorize_url params
      end

      def request_access_token(authorization_code, params={})
        raise Error::CSRF.new state, params[:state] if params[:state] && params[:state] != state

        params.reverse_merge! defaults(:redirect_uri)
        opts = { mode: :query, param_name: 'oauth2_access_token' }

        self.access_token = auth_code.get_token authorization_code, params, opts
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
linkedin2-0.0.5 lib/linkedin/api/authentication.rb
linkedin2-0.0.4 lib/linkedin/api/authentication.rb
linkedin2-0.0.3 lib/linkedin/api/authentication.rb
linkedin2-0.0.2 lib/linkedin/api/authentication.rb