Thanks for reaching out.
To authenticate users in Azure SQL database while they log in and generate an on-behalf flow to connect with the API along with a JWT Token, you can use Azure Active Directory (Azure AD) authentication with Azure SQL Database.
Azure AD authentication provides a way to authenticate users with Azure AD identities and access Azure SQL Database. You can use Azure AD authentication with Azure SQL Database to centrally manage the identities of database users and other Microsoft services in one central location.
To use Azure AD authentication with Azure SQL Database, you need to create an Azure AD application and configure it to access Azure SQL Database. You can then use the Azure AD application to authenticate users and obtain tokens to call APIs protected by Azure AD.
Here are the high-level steps to use Azure AD authentication with Azure SQL Database:
Create an Azure AD application and configure it to access Azure SQL Database.
Configure Azure SQL Database to use Azure AD authentication.
Authenticate users with Azure AD and obtain tokens to call APIs protected by Azure AD.
Use the obtained token to connect to Azure SQL Database.
You can find more information on how to use Azure AD authentication with Azure SQL Database in this document:
Hope this will help.
Thanks,
Shweta
Please remember to "Accept Answer" if answer helped you.