I
I
Ivan Vorobei2016-04-27 17:27:32
API
Ivan Vorobei, 2016-04-27 17:27:32

Single point authorization API with Lumen or Laravel?

I am writing an API for a project, I want to implement one-point authorization. Something like a single account for all projects, ie. once registered for all future projects, an account will do. It is very similar to registering on Habré with their TM.
I imagine the technical side as follows: First, an authorization window, if the login password and verification code (to confirm that this is not a left client) is suitable, a token is issued, the application saves it.
For example, a request for user authorization:
api.company.com/aouth/...
Further, all requests to the project go along with the issued token.
The request to the project is placed in a different place:
api.project.com/users/23...
The token is already checked on the server, a request is made for the api for the personal account.
As a conclusion: I need two separate Laravel or Lumen projects, one API is responsible for the application's access to the API and user authorization. Issues a token if everything is successful.
The second API saves the token and accesses the project API, which checks the token with the first API.
Maybe there are other solutions? Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
D', 2016-04-27
@ivanvorobei

In fact, there is little you can think of:
- Making a central repository with keys.
- We make a service that will authorize, issue keys and add them to the repository.
- On other services, we simply access the repository and check if there is a valid key.
The advantage is that the repository and the authorization service can be located anywhere and written in any language, since communication with them goes through the API.

A
Alex Wells, 2016-04-28
@Alex_Wells

Use JWT, no need to reinvent the wheel. Either OAuth2 is normal, there are a bunch of instructions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question