diff --git a/Rakefile b/Rakefile index e4d61ea5..beb9950a 100644 --- a/Rakefile +++ b/Rakefile @@ -8,7 +8,7 @@ task :default => [:test] desc 'Run tests' Rake::TestTask.new(:test) do |t| - t.ruby_opts = ["-rubygems"] if defined? Gem + t.ruby_opts = ["-r rubygems"] if defined? Gem t.libs << "lib" << "test" t.pattern = 'test/**/*_test.rb' t.verbose = true diff --git a/lib/podio/client.rb b/lib/podio/client.rb index 0cf0a0c4..659123f5 100644 --- a/lib/podio/client.rb +++ b/lib/podio/client.rb @@ -107,18 +107,16 @@ def authenticate_with_sso(attributes) end # Sign in with SAML SSO - if show_feature?(:sso_saml) - def authenticate_with_saml(attributes) - response = @oauth_connection.post do |req| - req.url '/oauth/token', :grant_type => 'saml', :client_id => SETTINGS.podio_api.default_client.api_key, :client_secret => SETTINGS.podio_api.default_client.api_secret - req.body = attributes - end - @oauth_token = OAuthToken.new(response.body) - configure_oauth - @oauth_token + def authenticate_with_saml(attributes) + response = @oauth_connection.post do |req| + req.url '/oauth/token', :grant_type => 'saml', :client_id => SETTINGS.podio_api.default_client.api_key, :client_secret => SETTINGS.podio_api.default_client.api_secret + req.body = attributes end + @oauth_token = OAuthToken.new(response.body) + configure_oauth + @oauth_token end - + # Sign in with an OpenID, only available for Podio def authenticate_with_openid(identifier, type) response = @trusted_connection.post do |req| @@ -201,11 +199,11 @@ def configure_connection builder.use Middleware::OAuth2, :podio_client => self builder.use Middleware::Logger, :podio_client => self - builder.adapter(*default_adapter) - # first response middleware defined get's executed last builder.use Middleware::ErrorResponse builder.use Middleware::JsonResponse + + builder.adapter(*default_adapter) end end diff --git a/podio.gemspec b/podio.gemspec index 26f26131..ec7a3c4b 100644 --- a/podio.gemspec +++ b/podio.gemspec @@ -17,9 +17,7 @@ Gem::Specification.new do |s| s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.require_paths = ['lib'] - s.has_rdoc = false - - s.add_dependency('faraday', ['>= 0.8.0', '< 0.10.0']) + s.add_dependency('faraday', ['>= 0.8.0', '< 0.16.0']) s.add_dependency('multi_json') if RUBY_VERSION < '1.9.3'