symfony users connexion with other database - symfony5.4

I would like my login form to fetch if the user exists from another external database
example: from the site: test1.com/login
fetches if the user exists from the test2.com database.
I tried to set up the multiple connection but I did not find another solution to my problem

Related

MongoDB - limit access to other databases using a connectionString

I want to create multiple databases, say db_1, db_2, etc. I have a single user called dashboard.
Now, I have a dashboard, and I want to limit access to the dbs, i.e. I want to use a connectionString such that the user dashboard only has access to db_1 and another connectionString such that the user dashboard only has access to db_2.
For example, if I were to use mongosh "mongodb+srv://dashboard:MY_PASSWORD#IP_ADDRESS/db1?tls=true&authSource=admin&replicaSet=IP_ADDRESS", you can the change the database to db2 if you want to. But I want to prevent that - that connection should only have access to db1
This can be accomplished by creating different users with limits on what they read, but I was hoping this could be done via a single user.
You can do something like you are wanting if the user dashboard is a user on each individual database, and not in the more "global" admin database.
The authSource=admin in your query string tells MongoDB which database to use to authenticate, and since you are pointing to admin it will always use the same user, the one in the admin database.
If two users have the same name but are created in different databases, they are two separate users. If you want to have a single user with permissions on multiple databases, create a single user with a role for each applicable database.
https://www.mongodb.com/docs/manual/core/security-users/#authentication-database
So you'd need to create a separate dashboard user in each database.
The docs and steps here maybe helpful:
https://www.mongodb.com/docs/manual/tutorial/create-users/#create-additional-users-for-your-deployment

Create New user Apache Atlas

There is an Apache Atlas server. The user connects using ldap technology. Users are adding the atlas-simple-authz-policy.json config file.json and specify its role in the application. We are faced with the following situation, until you create a user on the server itself (useradd nickname), the user will not receive full access within his role. I.e., in fact, the user will be able to log in to the application, perform some kind of search that will display the result, but it is already impossible to view the contents of the fragments found.

Symfony and DoctrineMongoDB : dynamic connections

I have been searching for days for my issue...
Context :
I use Symfony, i have customers, and each customer has its own database. I have a master database with all logins of all my customers, which after the login process, route the user to his own data...
The project use MongoDB for storing data. I am able to connect to a mongodb, store and retrieve data...
So this is my problem : How, with symfony and MongoDB, can i set dynamically the connection to the client database ? because of course, i won't know the database to connect until the user has logged in...

How isolate users data stored in SQL DB in MVC3

I have problem to find the best way how isolate users data stored in db.
Now if i login and access to my profile i can see data loaded from db.
example .../myprofile/PeterM
but if i manualy change address to .../myprofile/MartaM i see data stored in db for user marta
how can i isolate members data.
Thanks for my maybe stupid question.
You should always check that the user who is accessing the data is allowed to do so. Don't rely on just the querystring.
So for instance, instead of performing your database lookup based on the username in the querystring, get the information based off the currently authenticated user.
If I'm logged in as Brandon, then GetUser(HttpContext.Current.User.Identity.Name); should always return my information, regardless of whose name is passed in to the controller action.
Or just check that the username you're retrieving is the same as HttpContext.Current.User.Identity.Name

how to match a server database with with local database for iphone application

hi friend
can any one tell me that i have web server there i have create the database for store some value for registration form the value was save in webserver this is working good.
but now that data coming in json format and now i have fetch json value and save in to the local database which is same as the webserver database both the side same table and same colume name is there how can i do this in iphone application special for login page and other data also.
and how to write the query for this sitution help me friend
you can'nt match the local & remote database by using sql query,
you need to fetch the remote data using WEB API's then compare with your local database (local data will be accessed through sql query ).