Giter VIP home page Giter VIP logo

fusionauth-php-client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fusionauth-php-client's Issues

Timeouts and other cURL errors are not handled

When there's a read timeout, the response looks something like this:

FusionAuth\ClientResponse::__set_state(array(
   'errorResponse' => NULL,
   'exception' => NULL,
   'method' => 'PATCH',
   'request' => 
  array (
    'user' => 
    array (
        /* ... */
    ),
  ),
   'successResponse' => NULL,
   'status' => 0,
))

i.e. The errorResponse, exception, and successResponse are all NULL.

I think the code needs to use curl_errno to check for errors.

PSR autoload is failing because of case insensitive namespace

Expected behavior

FusionAuthClient class should autoload when used in code.

Actual behavior

Autoloading is failing on a case sensitive file system. The declared namespace is fusionauth, but the directory holding the class is FusionAuth. Composer will look for the case sensitive directory fusionauth and will not find it.

Possible solution

Rename the namespace in FusionAuthClient.php from fusionauth to FusionAuth.

getting invalid_redirect_uri

I am working on a passwordless login script. The email to the user works fine. But when the user clicks on the link in the email he gets invalid_redirect_uri (see image)
Screenshot from 2021-04-28 07-56-41

Here is the uri as it appears in the email:
<a href="http://fusionauth.ngrok.io/oauth2/passwordless/DM4l8LlDvIGzDOcixtjgCMMsFX8-4GqMbsCPGC7k0Cs?tenantId=4272f95b-0989-4892-badc-0ef6b934885f&amp;client_id=f603697d-41ea-4c53-ac2d-e935d5e34221&amp;redirect_uri=35.153.28.164%2Findex.php%2FConfigure%2Freport_generator_amazing&amp;response_type=code&amp;scope=openid&amp;state=bandfrombossanova%40gmail.com" target="_blank" data-saferedirecturl="https://www.google.com/url?q=http://fusionauth.ngrok.io/oauth2/passwordless/DM4l8LlDvIGzDOcixtjgCMMsFX8-4GqMbsCPGC7k0Cs?tenantId%3D4272f95b-0989-4892-badc-0ef6b934885f%26client_id%3Df603697d-41ea-4c53-ac2d-e935d5e34221%26redirect_uri%3D35.153.28.164%252Findex.php%252FConfigure%252Freport_generator_amazing%26response_type%3Dcode%26scope%3Dopenid%26state%3Dbandfrombossanova%2540gmail.com&amp;source=gmail&amp;ust=1619697345074000&amp;usg=AFQjCNFvFntwmztFJBGSbqjC1o8nwwfa9A"> <button style="border:none;color:white;padding:15px 32px;text-align:center;text-decoration:none;font-size:16px;margin:4px 2px;background-color:#008cba"> Click Here to Login! </button> </a>

I am using docker and fusionauth/fusionauth-app:1.19.7.
Is the error message correct? How can I fix this?

PHP Login User Example Does Not Work

The provided PHP login user example does not work for me.

Please assist me to solve it.

He's my code:

$apiKey = "[mykey]";

$client = new FusionAuth\FusionAuthClient($apiKey, "http://localhost:9011/api/login");

$applicationId = "[myid]";

$request = array();
$request["applicationId"] = $applicationId;
$request["email"] = "[email protected]";
$request["password"] = "12345";
$result = $client->login(json_encode($request));
if ($result->wasSuccessful()) {
$user = json_encode($result->successResponse->user);
echo $user;
}else{
$user = json_encode($result->errorResponse);
echo $user;
}

Here is the error I get:

{"fieldErrors":{"applicationId":[{"code":"[couldNotConvert]applicationId","message":"Invalid [applicationId]. This must be a valid UUID String (e.g. 25a872da-bb44-4af8-a43d-e7bcb5351ebc)."}],"loginId":[{"code":"[blank]loginId","message":"You must specify the [loginId] property."}],"password":[{"code":"[blank]password","message":"You must specify the [password] property."}],"userId":[{"code":"[couldNotConvert]userId","message":"Invalid userId on the URL [api]. This must be a valid UUID String (e.g. 25a872da-bb44-4af8-a43d-e7bcb5351ebc)."}]}}

Thanks.

Getting error due to Silent Mode

I am having some issues with configuring. From my docker log I am getting:

2021-02-19 6:31:49.102 AM WARN com.inversoft.configuration.BasePropertiesFileInversoftConfiguration - Your FusionAuth configuration file [/usr/local/fusionauth/fusionauth-app/apache-tomcat/../../config/fusionauth.properties] needs attention. Here are the warnings:

  • You are using a deprecated configuration property name of [DATABASE_ROOT_USER]. The new allowed names for that property are [database.root.username]

This is followed by this Silent Mode Error:
---------------------------------- Entering Silent Configuration Mode -----------------------------------

2021-02-19 6:31:49.153 AM ERROR com.inversoft.maintenance.db.JDBCURL - Could not parse jdbcString [jdbc:mysql:database-2.cwymdn16cxes.us-east-1.rds.amazonaws.com]
2021-02-19 6:31:49.162 AM ERROR com.inversoft.maintenance.db.DatabaseSilentConfigurationWorkflowTask - Encountered an error while running silent mode
java.lang.IllegalStateException: Invalid database URL [jdbc:mysql:database-2.cwymdn16cxes.us-east-1.rds.amazonaws.com]

I don't know why it is going into silent mode? Where is the config file located? I can't seem to find fusionauth.properties.

Support php 8.1

Currently this library does not support PHP version 8.1.x
This has to do with breaking changes with some deprecations and backward incompatible changes

Versions 8.0.x and below do work without any problems.
For now I can't update my app to 8.1 since it is dependent on this library.

forgotPassword method issue with TenantId

Hi

When sending a request using FA client v1.12 we're getting this message, despite the tenant id being passed and correct:

A Tenant Id is required to complete this request. To complete this request, you may assign a Tenant to your API key, or add the X-FusionAuth-TenantId HTTP request header with the Tenant Id.

The same problem doesn't happen on 1.11 or for any other API calls we use.

Is issue #833 back again?

I just added a third tenant and i am seeing this:
A 404 status code is returned from the Start Passwordless API when more than one tenant exists in FusionAuth.

This was solved in "Resolves GitHub Issue #833, thanks to @atrauzzi for reporting and helping us track this one down!"
This was reported solve din 1.19.0. I am using 1.19.7 and also experience this (it is repeatable). Can this be?

Please advise.

Delete Group Members does not have the expected API or its API is not documented

According to the FusionAuth documentation, there are two ways to remove a user from a group, and both use the URL to pass the request parameters to the FusionAuth API.

Either:
DELETE /api/group/member/{memberId}
or
DELETE /api/group/member?groupId={groupId}&userId={userId}

The method signature for deleteGroupMembers in this library seems designed to accept a JSON request body, but it is not clear how this body should be structured in order to remove a given user from a given group, since the documentation given above does not include removing users from a group using a request body.

Cut 'empty' params in request (JSONBody)

I'm trying to do something like this:
$request = [ 'loginId' => $hostData->getUser()->getUsername(), 'sendForgotPasswordEmail' => false ]; $response = $this->client->forgotPassword($request);
but library remove params sendForgotPasswordEmail. I found something like this in code (JSONBodyHandler:427)
$this->body = json_encode(array_filter($bodyObject));
function array_filter without callback remove all empty records from array. In my case remove sendForgotPasswordEmail but it is general problem with this function. It remove values with false and 0.

Methods using the JWT authorization are failing

Expected behavior

Calling any method using the JWT authorization should work just fine.

Actual behavior

The JWT authorization header is added after the API key authorization header. Curl will only use the first header, thus ignoring the JWT authorization header.

Possible solution

Replace any existing Authorization header when adding a new one.

Missing PHP version constraint

The composer.json file is missing a php version constraint, so it's unclear which versions of PHP are supported by this library.

Please add this information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.