Auth0 Home Blog Docs

Auth0 Login Login ServiceProvider

auth0
laravel

#1

I follow up this tutorial using Laravel 5.4 Creating your first Laravel app and adding authentication

But I can’t retrieve Auth0 users, the registration works fine in my dashboard new users are created in Auth0 server, but not in my local database and also I can’t dd(Auth0::getUser());

I get this error: Class ‘Auth0\Login\LoginServiceProvider’ not found
I’ve added this Auth0\Login\LoginServiceProvider::class, in my provider array and ‘Auth0’ => Auth0\Login\Facade\Auth0::class, in my aliases.

This is my controller

I did all steps on configuration from Auth0 docs: Auth0 PHP (Laravel) SDK

I’m out off option now!


#2

In relation to your statement about only seeing the users being persisted to Auth0 and not locally have in mind the following notes in the quickstart:

The plugin comes with an authentication driver called auth0. This driver defines a user structure that wraps the Normalized User Profile defined by Auth0, and it doesn’t actually persist the object, it just stores it in the session for future calls.
(…)
If you need a more advanced custom solution, you can extend the Auth0UserRepository class.

With the above in mind and in case you have not provided a custom implementation yet then that would explain why you’re only seeing users persisted to Auth0.


#3