balgev's avatar

Laravel + Passport VS Lumen + 3rd Party OAuth2 Servers

Hello, Gev here from ucraft.

I hope you all are fine, the great Laravel people :D

I am reaching out with a question that has been recently discussed a lot in our office!

We are thinking to setup an SSO for our app. For Auth Server we have chosen OAuth2.

We want to keep everything natively integrated with Laravel and to still keep it super fast.

So Laravel is suggesting to use Lumen for APIs, but it doesn't have smth like Passport on Laravel. So we might not want to use the whole Laravel with Passport just for Auth Server, but instead, we may use Lumen + a 3rd Party OAuth Library.

What are you thoughts? How can we achieve this, while still keeping everything Laravel/Lumen/OAuth2 way?

0 likes
1 reply
ibucur's avatar

Hi

Did you solved it in other way than codding it from scratch? I have the same issue and I am looking for a solution which will not consume more time to develop it.

The idea is the following:

  1. The client app will handle the user authorization requests for 3rd party oauth2 providers.
  2. once the client app gets the auth token from oauth2 3rd party provider, it will send to the server api.
  3. server api will connect to the oauth2 3rd party provider to exchange the auth token for a bearer token and get the user details.
  4. with the user data received, the authentication mechanism on api can continue based on the email address and will return a new bearer token or jwt token to the client app. this token will be used fwd to communicate with the api.

hope it helps

Please or to participate in this conversation.