Comments (13)
Hi @joshcanhelp , @lbalmaceda just wanted to put a brief note here as well for the internal eng. issue. I was able to reproduce the issue using this repository. Let me know if I can with anything else.
from laravel-auth0.
Hey @joshcanhelp ! That documentation was helpful during implementation, I've just run into a limitation running that setup. I can load my user from the database, and access all the data we define for the user in the database tables, or I can instead load the user using's Auth0's provided classes and get the Auth0 metadata for the user, but at the current time I can't really see how to load both sets of data on a single object. I'd like to have my user model extend the Auth0User
class provided by the plugin, but if I do, I lose access to the Eloquent methods that let me load the user from the database (and I am sure some other things). It feels like this could work if the Auth0 user extended the eloquent user, or could be made to more easily. Thanks!
This isn't a deal breaker btw, more of an improvement. We currently have the app on Laravel 5.2 if that matters.
Thanks!
from laravel-auth0.
@vomitHatSteve - "necroing" is my favorite word of the month now, thank you for that 😆
Happy to re-open this. We're working on a major in the 7.0.0 branch (not a lot there currently) and I'm guessing the changes required to get this working how it should will include some breakage.
I'm happy to take a first pass at this once we've got our SDK major released and working in the 7.0.0 branch here but open to PRs and suggestions in the meantime!
from laravel-auth0.
Thanks for the note here @dustinleblanc ... we have a section on our quickstart that addresses Auth0 login along with a database:
https://auth0.com/docs/quickstart/webapp/laravel#extra-custom-user-handling
Is that helpful or are you looking to do something else?
from laravel-auth0.
What, exactly, are you trying to do that you're unable to? Would it be possible to extend the Eloquent model to extract that user data, using the Auth0 class as an example?
I'm definitely open to a different implementation here, as long as it doesn't mean we break everything!
from laravel-auth0.
No activity, closing.
from laravel-auth0.
I don't know if this ticket should be re-opened but two use-cases include issue #114 and integrating with bouncer (https://github.com/JosephSilber/bouncer)
Apologies if necroing this thread is incorrect etiquette.
from laravel-auth0.
@vomitHatSteve @saltukalakus - Would you be able to give the change-user-model
branch a try and see if it works for you?
https://github.com/auth0/laravel-auth0/tree/change-user-model
from laravel-auth0.
This branch doesn't appear to introduce new issues for me, but I'm still stymied by #158 unfortunately.
from laravel-auth0.
I'm running into issues as well and I'm not skilled enough yet to fully understand it. I believe its that the user provider is not extending the native model? So I can't do something like:
Auth::guard(app('VoyagerGuard'))->getProvider()->getModel();
Its making it difficult to use some of these open source packages
from laravel-auth0.
@rlewkowicz - Does this branch solve your issue?
https://github.com/auth0/laravel-auth0/tree/change-user-model
Requires PHP 7.1, FYI.
from laravel-auth0.
We took a different approach here based on feedback. Please see the draft PR below to see what we're proposing:
That new trait can be added to the Eloquent User model which can be returned from a custom User repository. If anyone has feedback on this, we'd appreciate it!
from laravel-auth0.
Closing this ticket as it's quite stale at this point, but the next major of this Laravel plugin will include a refactored user model that will address this, based on the work in the PR Josh linked above
from laravel-auth0.
Related Issues (20)
- Version 7.8 environment configuration no longer calls system configuration just file HOT 1
- Laravel Telescope compatibility issue HOT 11
- Error on custom repository and model HOT 1
- Incorrect middleware ordering HOT 9
- Laravel Auth0 breaks when Laravel Telescope is Installed HOT 1
- SDK hitting database many times for user HOT 3
- Can not access web routes protected with the auth Middleware HOT 3
- v7.10.0 breaks permissions guards HOT 2
- Name and Email values not set after call to management API, after adding User Repository HOT 5
- Upgrading to 7.10 from 7.1 causing - PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 65536 bytes) HOT 1
- 7.7+ integration questions HOT 4
- Fresh Installation - The JWT string must contain two dots HOT 2
- Restore 7.6 feature of configurable login route HOT 3
- Add more information to exceptions HOT 1
- 'auth0.authorize' replacement for RouteRegistrar? HOT 1
- Trigger a password reset email HOT 2
- Performance: Prevent Duplicate Calls to getCredentials() HOT 3
- InvalidTokenException "The JWT string must contain two dots" when decoding token for regular (non-API) applications (with AUTH0_AUDIENCE=[blank]) HOT 3
- feat: add Laravel Queues support HOT 1
- feat: add `Illuminate\Support\Traits\Macroable` trait to Guards HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-auth0.