User Unauthorised error

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
traiyani75
Advanced
Posts: 114
Joined: 08 Nov 2019, 11:56

User Unauthorised error

Post by traiyani75 » 30 Jan 2021, 19:45

Hello,

We are using laravel as backed and using JSONAPIs on mobile applications. We are having issue on user session + login. Right now, we are having two stores and two different apps are running on individual store.

As we have both store live, so we are getting issues on old store users. Some users are getting unauthorised error when they to login into system to place an order. How do we handle case? As we don't have option to update password for them from admin or via JSON APIs. How do we allow user to reset their password ? Or if we can update same thing on aimeos admin side then also it will be helpful.

THANKS IN ADVANCE

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

Re: User Unauthorised error

Post by aimeos » 01 Feb 2021, 08:44

Don't think it's a password issue but it may be an issue that the customers aren't assigned to the correct site due to a wrong siteid value in the "users" table. Please check if that value matches with the site the customer should be able to log in.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

traiyani75
Advanced
Posts: 114
Joined: 08 Nov 2019, 11:56

Re: User Unauthorised error

Post by traiyani75 » 02 Feb 2021, 11:40

I dont think that site is the issue. If site is the issue, then it should return user not found.
But here, we are getting unauthorized error.

Thanks

traiyani75
Advanced
Posts: 114
Joined: 08 Nov 2019, 11:56

Re: User Unauthorised error

Post by traiyani75 » 04 Feb 2021, 14:07

How do we reset password for user, either via api or from admin?

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

Re: User Unauthorised error

Post by aimeos » 05 Feb 2021, 06:51

In the admin backend, go to the Customer panel. In the detail view there's a password field for each customer.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

traiyani75
Advanced
Posts: 114
Joined: 08 Nov 2019, 11:56

Re: User Unauthorised error

Post by traiyani75 » 05 Feb 2021, 12:09

Thanks for the help. Issue is resolved

createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Re: User Unauthorised error

Post by createanet » 15 Apr 2021, 08:42

traiyani75 wrote: 30 Jan 2021, 19:45 Hello,

We are using laravel as backed and using JSONAPIs on mobile applications. We are having issue on user session + login. Right now, we are having two stores and two different apps are running on individual store.

As we have both store live, so we are getting issues on old store users. Some users are getting unauthorised error when they to login into system to place an order. How do we handle case? As we don't have option to update password for them from admin or via JSON APIs. How do we allow user to reset their password ? Or if we can update same thing on aimeos admin side then also it will be helpful.

THANKS IN ADVANCE
Hi, do you mind me asking how you are handling sessions?

Obviously mobiles are stateless and creating baskets with no session is not possible.

TY

[edit]

Sorry, I should probably have said mobile "applications", ie. apps distributed via playstore or appstore.

traiyani75
Advanced
Posts: 114
Joined: 08 Nov 2019, 11:56

Re: User Unauthorised error

Post by traiyani75 » 03 May 2021, 19:51

hello, we have prepare api to get session token and save that token into cookies via okhttp lib method on android side. and same for ios.
So, whenever we start the application we are taking the latest token. By the time if token expired then aimeos will return new token, but if its not then we will get old token again. And once token will be retrieved we are checking the session with user. Either user is attached with the session or not (by calling custom details api end point). If it is attached with user , then API will return user details.

If API will not return any error, then we are doing login user API call again to attach user with session. Thanks

createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Re: User Unauthorised error

Post by createanet » 05 May 2021, 09:01

Hi traiyani75,

I think we're doing the same thing. Your session token is perhaps the bearer token issued by a guard, eg. laravel sanctum?

I have no issue authenticating api requests, and/or as you mention retrieving the customers details.

My only issue right now, is similar to another post you created, is that my basket isn't persisting as it relies on sessions until stored. Because the basket is split into several requirements (addresses, services, products, coupons etc) I was hoping to split my requests into steps similar to the website.

Is it possible for you to share a little more on how you managed this please?

Thank you

Post Reply