deathmetalgore's avatar

User login and registration with Lumen OAuth2 API

This is the first time I'm creating an API and planning to make use of it via a Javascript front end framework (EmberJS), so I'm a bit confused how the login and registration process will go exactly.

The API is being created in PHP via the Laravel Lumen Framework. So far I have finished the OAuth2 authentication part, but I have only used dummy users to test it. So since an user needs to already exist to be able to use the API and receive the access token etc., how do I take care of registering the user?

Do I simply create a route that is not tied to the OAuth2 checks (middleware) and have my EmberJS application send registration data to that unprotected route? How can I limit registrations coming only from localhost or a specific IP?

It's also worth mentioning that my API and front end will be on separate servers.

So how do I handle user registration and login exactly in a situation like this?

0 likes
0 replies

Please or to participate in this conversation.