I am currently writing a front-end application that will communicates with a separate backend application (on an another server) by using a REST API.
Now I like to login a user on the frontend app by using the REST API for authenticating and needed data. All the users are stored in the database of the backend app.
How can I do this, on the internet I only found examples where a database is used, how can I implement my REST backend for the login process. The database where the info is stored is looking like this;
(and a lot of other fields that are not relevant)
The API itself is also based on Yii2 and managed by me, so I can create new actions there if needed for providing the right data.
Your REST API is effectively a database layer for your application. So in your User model instead of db to get user data - just call your API instead of db. You probably can’t use IdentityInterface implementation directly, but you can easily change it to authenticate user by REST call that takes username and password and returns access-token, that you can use later on to call API. I did something similar, althrough I’m hosting everything within one provider so in my frontend I still use my db to authenticate user.