fusionauth / fusionauth-ruby-client Goto Github PK
View Code? Open in Web Editor NEWRuby client library for FusionAuth
Home Page: https://fusionauth.io
License: Apache License 2.0
Ruby client library for FusionAuth
Home Page: https://fusionauth.io
License: Apache License 2.0
The user API declares that username or email must be declared in request body - if they are included for identification then the user cannot update them?
Assuming the request body is the second parameter sent in the formatted JSON as specified in the User API an example request that I use that results in a 200 but no update to the user is:
{\"firstName\":\"Bertie\",\"lastName\":\"G\",\"email\":\"[email protected]\"}
patch_user method :
returns success response with status 200 but none of the information is updated, user information in user table in database remains unchanged.
Methods are not defined in repo with a bang, if you follow the documentation
id = SecureRandom.uuid
**client.register!(id, {**
:user => {
:firstName => 'Ruby',
:lastName => 'Client',
:email => '[email protected]',
:password => 'password'
},
:registration => {
:applicationId => application_id,
:data => {
:foo => 'bar'
},
:preferredLanguages => %w(en fr),
:roles => %w(user)
}
})
# Authenticate the user
**response = client.login!({**
:loginId => '[email protected]',
:password => 'password',
:applicationId => application_id
})
user = response.user
Removing the bang operator allows proper function of the methods
# Authenticate the user
response = client.login!({
:loginId => '[email protected]',
:password => 'password',
:applicationId => application_id
})
user = response.user
response.user returns nil
working format: response.success.response.user
When attempting to re-activate a user, the library returns the following error:
#<OpenStruct fieldErrors=#<OpenStruct>, generalErrors=[#<OpenStruct code="[InvalidContentType]", message="Invalid [Content-Type] HTTP request header value of [application/x-www-form-urlencoded]. Supported values for this request include [application/json].">]>
version 1.42.0
Steps to recreate:
Code snippet:
require 'fusionauth/fusionauth_client'
# Construct the FusionAuth Client
client = FusionAuth::FusionAuthClient.new(
'xxxxxxxxxxx',
'http://localhost:9011'
)
# # Deactivate a user
user_id = '123'
response = client.deactivate_user(user_id)
# Reactivate a user
response = client.reactivate_user(user_id)`
Solution:
FusionAuth should correctly handle the Content-Type for this method so no error is returned, perhaps defaulting to 'application/json`.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.