Sha256: 4a89c11c0bae10f412be7bd67f8bd060edfca12e8fd4e396ae1e02af3cb47460

Contents?: true

Size: 774 Bytes

Versions: 17

Compression:

Stored size: 774 Bytes

Contents

require 'fusionauth/fusionauth_client'
require 'securerandom'

# Construct the FusionAuth Client
client = FusionAuth::FusionAuthClient.new(
    'APIKEY', 
    'http://localhost:9011'
)

application_id = '20ce6dac-b985-4c77-bb59-6369249f884b'

# Create a user + registration
id = SecureRandom.uuid
response = client.register(id, {
    :user => {
        :firstName => 'Ruby',
        :lastName => 'Client',
        :email => 'ruby.client.test@fusionauth.io',
        :password => 'password'
    },
    :registration => {
        :applicationId => application_id,
        :data => {
            :foo => 'bar'
        },
        :preferredLanguages => %w(en fr),
        :roles => %w(user)
    }
})

unless response.success_response
  print response.error_response
  exit
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
fusionauth_client-1.53.0 examples/create_user.rb
fusionauth_client-1.52.0 examples/create_user.rb
fusionauth_client-1.51.0 examples/create_user.rb
fusionauth_client-1.50.0 examples/create_user.rb
fusionauth_client-1.49.1 examples/create_user.rb
fusionauth_client-1.48.0 examples/create_user.rb
fusionauth_client-1.47.0 examples/create_user.rb
fusionauth_client-1.46.0 examples/create_user.rb
fusionauth_client-1.45.0 examples/create_user.rb
fusionauth_client-1.44.0 examples/create_user.rb
fusionauth_client-1.43.0 examples/create_user.rb
fusionauth_client-1.42.1 examples/create_user.rb
fusionauth_client-1.42.0 examples/create_user.rb
fusionauth_client-1.41.0 examples/create_user.rb
fusionauth_client-1.39.0 examples/create_user.rb
fusionauth_client-1.38.0 examples/create_user.rb
fusionauth_client-1.37.0 examples/create_user.rb