Skip to content

illustrativemathematics/fusionauth-ruby-client

 
 

Repository files navigation

FusionAuth::FusionAuthClient

This gem is the Ruby client library that helps connect Ruby applications to the FusionAuth (https://fusionauth.io) Identity and User Management platform.

Getting Started

Installation

Add this line to your application’s Gemfile:

gem 'fusionauth_client'

And then execute:

bundle

Or install it yourself as:

gem install fusionauth_client

Usage

Once the gem is installed, you can call FusionAuth APIs.

require 'fusionauth/fusionauth_client'
require 'securerandom'
require 'pp'

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

application_id = '85a03867-dccf-4882-adde-1a79aeec50df'

# Create a user + registration
id = SecureRandom.uuid
response = client.register(id, {
    user: {
        firstName: 'Ruby',
        lastName: 'User',
        email: '[email protected]',
        password: 'password'
    },
    registration: {
        applicationId: application_id,
        data: {
            foo: 'bar'
        },
        preferredLanguages: %w(en fr),
        roles: %w(dev)
    }
})

#pp response
if response.success_response
  pp response.success_response
else
  if response.exception
    # if we can't connect
    print response.exception
  end
  print "status: #{response.status}"
  print response.error_response
  exit
end

Documentation

Documentation can be found at doc.

Questions and support

If you have a question or support issue regarding this client library, we’d love to hear from you.

If you have a paid edition with support included, please open a ticket in your account portal. Learn more about paid editions here.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/FusionAuth/fusionauth-ruby-client.

All issues filed in this repository must abide by the [FusionAuth community guidelines](https://fusionauth.io/community/forum/topic/1000/code-of-conduct).

License

This code is available as open source under the terms of the Apache v2.0 License.

About

Ruby client library for FusionAuth

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%