Skip to content
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

Connect to Azure SQL using Azure AD Authentication per user #358

Closed
rohit12sh opened this issue Nov 28, 2020 · 1 comment
Closed

Connect to Azure SQL using Azure AD Authentication per user #358

rohit12sh opened this issue Nov 28, 2020 · 1 comment

Comments

@rohit12sh
Copy link

I'm submitting a...


[ ] Regression 
[ ] Bug report
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

My current setup that works fine to connect to the the Azure SQL Server DB using a service account:
SequelizeModule.forRoot({ dialect: 'mssql', host: envConfig.DB_HOST, port: envConfig.DB_PORT, username: envConfig.DB_USER, password: envConfig.DB_PASSWORD, database: envConfig.DB_NAME, models: [Model01, Model02], synchronize: true, dialectOptions: { options: { encrypt: true, enableArithAbort: true, connectionIsolationLevel: ISOLATION_LEVEL.READ_UNCOMMITTED, requestTimeout: 300000 } } })

I already have Azure AD integrating in my App that gives me accessToken. From tedious documentation I can see there is a way to specify authentication setting like this:
authentication: { type: 'azure-active-directory-access-token', options: { token: 'access-token-from-azure-ad-login' } }

Could you please point me to the documentation/configuration how can I initiate DB connection for each of the logged-in user by passing their accessToken to the SequelizeModule configuration with Model definition I posted above.

Thanks,

@kamilmysliwiec
Copy link
Member

Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants