Sha256: 82203b41dc4561486ede7a6e1ce18e64636609ae0b32ad2bcffade442b293c0f

Contents?: true

Size: 538 Bytes

Versions: 17

Compression:

Stored size: 538 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'

# Authenticate a user
response = client.login({
    :loginId => 'ruby.client.test@fusionauth.io',
    :password => 'password',
    :applicationId => application_id
})

if response.success_response
  user = response.success_response.user
  print user.id
else 
  print response.error_response
end

Version data entries

17 entries across 17 versions & 1 rubygems

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