-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi Auth system in laravel #153
Comments
Sorry, could you give more clarification on your use case? What was the setup (Laravel and DynamoDB)? What is the expectation of using this library? What do you want to achieve? |
Hi @baopham, sorry for the late reply. is it clear from the above definition what I am trying to achieve? |
This library doesn't work with Laravel auth out of the box. Usually when you want "users", you would want "roles" too and that involves setting up relationship like many-to-many and DynamoDB doesn't play well with that. But seems like there is a need for it as you're not the first person asking about auth. Please refer to #157 for progress (if I happen to get enough time to work on it). |
If using DynamoDB, I’d recommend Cognito as an auth backend. My app does client side auth, and passes an auth token cookie to the server - whenever I need to check if the user is logged in, that token goes through my custom Cognito auth middleware which verifies the jwtToken. IF my backend needs access to the User record itself, then I pull it out of Cognito/DynamoDB depending on what I’m doing (Cognito syncs profile data with Dynamo, but not the other way around). It results in very few reads from Dynamo, and does not require my backend to cache the user either... as I usually don’t need to know anything other than “are they logged in” or “are they a member of X group”. Vue is used to render any user specific data on the front end - such as username in the user dropdown of the menu, etc. |
I am also interetsed in multi-auth integration. @zoul0813 can you explain a little more about your cognito middleware in laravel? Are you using this package https://github.com/black-bits/laravel-cognito-auth? |
@foo123, no. I use the cognito client side JavaScript to authenticate and simply pass the auth token that Cognito generates as a cookie. The middleware was custom written, and just decided the jwt auth token and verified it. If it was valid, then the user was authenticated. I had it setup to sync Cognito user data with a lambda function, which wrote the data to dynamodb. My profile edit was also client side, and would write data to Cognito... which would then trigger the lambda sync. Unfortunately, I can’t provide any code or examples as I’m not longer working on that project and do not have access to it. |
@zoul0813 that is fair enough explanation. Got it. Thanks! |
I am doing a project where multi-auth is necessary. Does this package support laravel multi-auth? even though I set up project environment as multi auth suggests, DynamDB package always getting the content of user model.
The text was updated successfully, but these errors were encountered: