Sha256: 26b9f4fc6d58b2de6f53f9c1947d4d37f30b03e198b0d807d2682152785f4119

Contents?: true

Size: 763 Bytes

Versions: 21

Compression:

Stored size: 763 Bytes

Contents

module DiscourseApi
  module API
    module SSO
      def sync_sso(params={})
        sso = DiscourseApi::SingleSignOn.new
        sso.sso_secret = params[:sso_secret]
        sso.name = params[:name]
        sso.username = params[:username]
        sso.email = params[:email]
        sso.external_id = params[:external_id]
        sso.suppress_welcome_message = params[:suppress_welcome_message] === true
        sso.avatar_url = params[:avatar_url]
        sso.avatar_force_update = params[:avatar_force_update] === true
        params.keys.select{|key| key.to_s.start_with?("custom") }.each do |custom_key|
          sso.custom_fields[custom_key] = params[custom_key]
        end

        post("/admin/users/sync_sso", sso.payload)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
discourse_api-0.16.1 lib/discourse_api/api/sso.rb
discourse_api-0.16.0 lib/discourse_api/api/sso.rb
discourse_api-0.15.0 lib/discourse_api/api/sso.rb
discourse_api-0.14.1 lib/discourse_api/api/sso.rb
discourse_api-0.14.0 lib/discourse_api/api/sso.rb
discourse_api-0.13.0 lib/discourse_api/api/sso.rb
discourse_api-0.12.0 lib/discourse_api/api/sso.rb
discourse_api-0.10.1 lib/discourse_api/api/sso.rb
discourse_api-0.10.0 lib/discourse_api/api/sso.rb
discourse_api-0.9.1 lib/discourse_api/api/sso.rb
discourse_api-0.9.0 lib/discourse_api/api/sso.rb
discourse_api-0.8.1 lib/discourse_api/api/sso.rb
discourse_api-0.8.0 lib/discourse_api/api/sso.rb
discourse_api-0.7.0 lib/discourse_api/api/sso.rb
discourse_api-0.6.2 lib/discourse_api/api/sso.rb
discourse_api-0.6.1 lib/discourse_api/api/sso.rb
discourse_api-0.6.0 lib/discourse_api/api/sso.rb
discourse_api-0.5.1 lib/discourse_api/api/sso.rb
discourse_api-0.5.0 lib/discourse_api/api/sso.rb
discourse_api-0.4.4 lib/discourse_api/api/sso.rb