Sha256: 8d4e4bd0c4c6b8637ce49c3ca8a323de38be96689d4eb4212693d82bbdb714ee

Contents?: true

Size: 798 Bytes

Versions: 14

Compression:

Stored size: 798 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.title = params[:title]
        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

14 entries across 14 versions & 1 rubygems

Version Path
discourse_api-0.28.1 lib/discourse_api/api/sso.rb
discourse_api-0.28.0 lib/discourse_api/api/sso.rb
discourse_api-0.27.0 lib/discourse_api/api/sso.rb
discourse_api-0.26.0 lib/discourse_api/api/sso.rb
discourse_api-0.25.0 lib/discourse_api/api/sso.rb
discourse_api-0.24.0 lib/discourse_api/api/sso.rb
discourse_api-0.23.1 lib/discourse_api/api/sso.rb
discourse_api-0.23.0 lib/discourse_api/api/sso.rb
discourse_api-0.22.0 lib/discourse_api/api/sso.rb
discourse_api-0.20.1 lib/discourse_api/api/sso.rb
discourse_api-0.20.0 lib/discourse_api/api/sso.rb
discourse_api-0.19.0 lib/discourse_api/api/sso.rb
discourse_api-0.18.0 lib/discourse_api/api/sso.rb
discourse_api-0.17.0 lib/discourse_api/api/sso.rb