Login API

Help for integrating the Laravel package
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!
veeran ambalam
Posts: 19
Joined: 06 Mar 2021, 14:51

Login API

Post by veeran ambalam » 10 Apr 2021, 05:12

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

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Login API

Post by aimeos » 11 Apr 2021, 12:10

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, Image give us a star

veeran ambalam
Posts: 19
Joined: 06 Mar 2021, 14:51

Re: Login API

Post by veeran ambalam » 11 Apr 2021, 16:57

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);
}
);

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Login API

Post by aimeos » 11 Apr 2021, 17:01

Do you send the Laravel session token with your request?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply