How to create a multi sql server authentication user with Laravel - sql-server

I'm building an app using Laravel and SQL Server. What I want is to be able to use the Server Authentication Users as the user of my app. For example when a user want to connect to the application his login must be a Server Authentication User that will connect to the database just as it is done in the .env file. How can i so that?
(Sorry for my bad English)

Related

Razor Page Pass Through Azure AD login to Azure SQL DB

Background: I built a Razor Pages web app that connects to Azure SQL DB and have successfully set up Azure AD single sign on. I have a DB context class which use AD interactive authentication, but when I publish the app to the Web App Service, I have to configure the Azure SQL DB dependency and I am forced to hard-code a username and password.
I have created users and logins in the DB and also utilize RLS as not all users have a need to see all data in certain tables, so I want to retain the security measures already in place.
Problem: Because the username and password are hard-coded all users will be able to see, edit, delete information they shouldn't, so I need to configure pass-through authentication to the DB.
Anyone have examples on how to achieve this?
Edit: Just how you can configure Power BI to have end users use their own credentials to access the SQL DB, I need to this with my web app.
If you want to protect the username and password, some other way is that you can store the SQL database connection string to the Azure Key Vault, then use secret key name to connect to the SQL database.
Example ref: Spring boot application that would read configuration from Key vault and connect to SQL?

Microsoft Access: connecting to SQL Server via Active Directory username and password Trusted_Connection=no

I have a Microsoft Access Application which generates a connection string like:
Provider=SQLNCLI11;Server=servername;Database=db_name;Trusted_Connection=yes;
This works without any problem.
What I want to do is to connect to a SQL Server instance where the user must insert his Active Directory name and password.
Like this:
Provider=SQLNCLI11;Server=servername;Database=db_name;Uid=username;Pwd=password;
This only works for users which are created on the SQL Server directly.
I tried Uid=DOMAIN\username, but it isn't working.
Is this possible? Or is there another way how I can get through this?
The environment:
The User is using a local PC with a local account and then he's doing a "NetworkConnect" with his AD-User and password.
After that, "RunAs" as his AD-User is working BUT there is another Application that is started from the Access Application and this App must be started with the local User-Account.
SQL-Server and the AD-User are member of the same domain.
Your choices are
Login to SQL Server using your the Windows Domain account that you are currently logged into. You do this automatically by specifying Trusted_Connection=yes;, or
Login to SQL Server using a SQL Login.
Those are the only two choices possible using a SQL provider connection string. Specifically, you cannot use the SQL access provider to do impersonation, that is, to login to SQL Server using a different Windows domain account than the one that you are currently logged into.
Microsoft designed the AD integration with SQL Server to use the account of the client application, not to be able to handle logging in as a part of the connection string. If the user isn't going to be logged into the machine using the account needed for the database access, the next best option may be something like ShellRunAs in order to let the user run your client app as the correct AD account.

AngularJS Server session & authentication with nodeJS backend server

I have a front-end angularJS server that is getting data from a back-end nodeJS server from MySQL DB via middleware.
I created a front-end simple login form that needs to send data for authentication to the back-end server (checks if user exists in the db).
The back-end server returns user details in the case that the user is found in the DB or prints error login message or redirect to signup screen.
I'm looking for a guide or example on how to create a correct authentication system with sessions and cookies between the two servers.
Thank you.
You should choose use a token authentication or use cookies.
Take a look at this,it is a good guide :
http://code.tutsplus.com/tutorials/token-based-authentication-with-angularjs-nodejs--cms-22543

Store application logged in user into SQL Server session connection

Is there a way on SQL Server to store the application logged in username into the connection?
We have this Java application which uses the same DB user for a multiconnection datasource, and we want to be able to know what is the app user using each connection.
Thank you

Configure IIS to impersonate a user for SQL Integrated Authentication

I have a question about how to configure my web site and IIS using Active Directory.
I have a web app which will be running exclusively on our company's internal network. The SQL Database that the app needs to connect to (via active directory) can only be accessed by one specific AD user DBAccess but I am using Windows Authentication mode to validate my users. I would put the identity impersonate right into my Web.Config but the DB user does not have rights on the web server computer.
How would I configure IIS to use the DB Access user for connecting to the SQL Server and not for running locally on the web server?
Thanks in advance and sorry if this is a bit basic.
Set the application pool your application is using to run as the user you wish to connect to the DB as.
Add Integrated Security=true; to your connection string.

Resources