php-crud-api
php-crud-api copied to clipboard
help wanted: is it possible and it makes any sense to mix dbauth and jwt auth?
actually the subject is already the matter..
In particular: I would like to use both social login (like google or facebook or whatever) with my own jwt auth mode. I would/should such a mechanism be structured?
@nik2208 I would be happy to know about this too. This issue here closely relates to your question.
I would like to use both social login (like google or facebook or whatever) with my own jwt auth mode. I would/should such a mechanism be structured?
I think auth0 fits your needs, see: https://auth0.com/
I would use php-crud-auth instead of auth0 (they should actually do the same job, right?), but I actually don't really figure out how to mix (e.g) users coming from google login and others coming from php-crud-auth login to converge to the same php-crud-api session. Could I explain what I mean?
they should actually do the same job, right?
No, auth0 has the social logins implemented and with php-api-auth you will have to build those social login integrations for yourself.
you will have to build those social login integrations for yourself
that is already done: I can successfully login with google and get the user's email back (and the token, actually). but now I find myself in this situation: I have users registered thru php-crud-api dbAuth, and users coming from google which are not (yes) in the users table. Should I enable both dbAuth and JWT, or are them mutual exclusive? is api.php able to recognise which user use what and simply create a user without a password if coming from google?
maybe I'm missing something..
I would avoid using auth0 as sole authentication method in this phase of the development, so I'm wondering: do I have to implement my own JWT auth method (and I would use php-crud-auth for that) and remove dbAuth as auth method option from php-crud-api?
do I have to implement my own JWT auth method (and I would use php-crud-auth for that) and remove dbAuth as auth method option from php-crud-api?
Yes, that is what I would do.
I'm closing the issue for now. Feel free to follow-up if you have any further questions, either on this issue (I'll re-open) or on a new one.
I've implemented my own auth provider using multiple instances of api.php. I'll be sharing my general approach and the mods I've done to auth.php to achieve the goal.