Comments (5)
It works fine now.
Thanks!
from fusionauth-php-client.
The JSON response indicates you are not sending in a valid UUID for the applicationId
field, and you will want to use loginId
instead of email
in the JSON body. Did you find an example using email
somewhere?
{
"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)."
}
]
}
}
Your incoming JSON should look something like this
( https://fusionauth.io/docs/v1/tech/apis/login#authenticate-a-user )
{
"applicationId": "fbbf82ff-cc36-4540-aa30-578a57f12e61",
"loginId": "[email protected]",
"password": "12345"
}
from fusionauth-php-client.
Thanks for your reply.
The email example is in the example code for this PHP documentation.
Even if I use the loginId instead of email in the JSON body, the error still persists.
If I echo the request array, it looks exactly as this example.
It seems this issue occurs when implementing the FusionAuth PHP client for making POST requests. While making GET requests, such as retrieveUserByEmail works fine, POST requests return errors.
Even the other POST requests seems to be having the same problem.
However, if I make POST requests using the FusionAuth API, without the PHP client library, everything works well.
from fusionauth-php-client.
I'll see if I can recreate.
from fusionauth-php-client.
Ah, I see your error. Change your call from
$result = $client->login(json_encode($request));
to
$result = $client->login($request);
the client handles the JSON encoding. I've corrected the example in the README.
from fusionauth-php-client.
Related Issues (16)
- PSR autoload is failing because of case insensitive namespace HOT 1
- forgotPassword method issue with TenantId HOT 6
- No X-FusionAuth-TenantId header when using withTenantId method HOT 1
- User Sign In Successfully but NOT Signed In to FusionAuth & Everywhere HOT 1
- Delete Group Members does not have the expected API or its API is not documented HOT 1
- Is issue #833 back again? HOT 7
- Getting error due to Silent Mode HOT 1
- Cut 'empty' params in request (JSONBody) HOT 2
- getting invalid_redirect_uri HOT 1
- Support php 8.1 HOT 1
- Missing PHP version constraint HOT 4
- Timeouts and other cURL errors are not handled HOT 1
- Deprecated doc
- Methods using the JWT authorization are failing HOT 1
- option to set TenantID is missing. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fusionauth-php-client.