DependencyTrack / DependencyTrack/dependency-track

Cannot use "Authentication=ActiveDirectoryMSI" with "User", "UserName" or "Password" connection string keywords.

Open
#4,343 1 comment 0 reactions 0 assignees View on GitHub
defect in triage
Dominant language
Java
Stars
4.2k
Forks
811
Avg merge
8h 39m
Merged PRs (30d)
237

Description

### Current Behavior

Seem like docker image have default value for username/password and they are blocking connection to database using managed identity, we get this error when trying to start the container

`2024-10-29T10:12:32.385140481Z Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot use "Authentication=ActiveDirectoryMSI" with "User", "UserName" or "Password" connection string keywords.
`

We set `ALPINE_DATABASE_URL` for the connection string

> jdbc:sqlserver://[...].database.windows.net:1433;database=[...];encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryMSI;msiClientId=[...]

I also try to set `ALPINE_DATABASE_USERNAME `and `ALPINE_DATABASE_PASSWORD ` to empty but it does not work. Other applications like SonarQube, ... all work well with jdbc connection string so I can think of any issue rather than the dependency track itself

### Steps to Reproduce

1. Create sqlserver, with entra id authentication
2. Conduct the connection string with Authentication=ActiveDirectoryMSI
3. Deploy dependency apiserver with `ALPINE_DATABASE_URL`

### Expected Behavior

Application work with connection string

### Dependency-Track Version

4.8.x

### Dependency-Track Distribution

Container Image

### Database Server

Microsoft SQL Server

### Database Server Version

12.5

### Browser

Google Chrome

### Checklist

- [x] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [x] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.