Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tomvoss's avatar

Auth0 integration with Spark

I'm looking to integrate Auth0 with Laravel Spark. The information available in the Laracast at https://laracasts.com/discuss/channels/laravel/using-third-party-authentication-like-parse-or-auth0 appears to be helpful for pure Laravel, but I'm not so sure it will help me as a Spark developer.

Spark's UserRepository contract interface has the following signature which is quite different than Laravel's stock UserRepository:

public function current(); public function find($id); public function search($query, $excludeUser = null); public function create(array $data); public function updateBillingAddress($user, array $data); public function updateVatId($user, $vatId);

As you can see, getUserByDecodedJWT($jwt), getUserByUserInfo($userInfo), and getUserByIdentifier($identifier) are all missing. In my custom UserRepository do I need to implement both Spark's contract and Auth0's contract?

@glena can you provide some guidance?

0 likes
4 replies
tomvoss's avatar

I only received one response and it was via email.

"I am not really familiar with Spark but my guess is that you should implement both. I would suggest you to create your own UserRepository implementing both contracts (auth0's and spark's) and that should do the trick."

I decided that this community wasn't supportive enough for what I had planned so I built a React app instead.

jhc333's avatar

Ah, too bad. I figured it out after a few hours of debugging. Turns out the solution is to implement the custom repository but keep the default auth driver ("eloquent").

scottybowl's avatar

Would it be possible to share your solution @jhc333

Struggling to find much information on this...

Please or to participate in this conversation.