Login API
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 19
- Joined: 06 Mar 2021, 14:51
Login API
I am a newbie to laravel and Aimeos, It seems there is no documentation for login API, So If there is an idea of how to do it, kindly share me. I tried using the same login controller and authenticate but when I try to get customer details it returns null
Re: Login API
Authentication is handled by Laravel resp. Lararvel packages like Passport or Sanctum and you have to read their documentation to set up API authentication for Laravel.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 19
- Joined: 06 Mar 2021, 14:51
Re: Login API
Yes I used Passport, created an access token using but when I use it for customer API it returns null, I dont am i doing it the right way.
Route::post('login-app', [AccessTokenController::class, 'issueToken'])->middleware(['api-login', 'throttle']);
const config = {
headers: {
"Content-type": "application/json",
"Authorization": `Bearer ${this.state.access_token}`,
},
};
axios.get("http://localhost:8000/jsonapi/customer", null, config)
.then((response) => {
console.log(response.data);
})
.catch((err) => {
console.log(err);
}
);
Route::post('login-app', [AccessTokenController::class, 'issueToken'])->middleware(['api-login', 'throttle']);
const config = {
headers: {
"Content-type": "application/json",
"Authorization": `Bearer ${this.state.access_token}`,
},
};
axios.get("http://localhost:8000/jsonapi/customer", null, config)
.then((response) => {
console.log(response.data);
})
.catch((err) => {
console.log(err);
}
);
Re: Login API
Do you send the Laravel session token with your request?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
