A SQL Server login is refused with 403
A sign-in with name and password (HTTP Basic; in the driver, UID/PWD) gets 403.
Environment
AuthMode with SqlLogin; alias with AllowSqlLogins.
Cause
| Message | Cause |
|---|---|
| “SQL-Anmeldungen nimmt der Dienst nur ueber eine verschluesselte Verbindung an.” (The service accepts SQL Server logins only over an encrypted connection.) | The password came unprotected from another computer: neither HTTPS nor a trusted proxy with X-Forwarded-Proto: https nor a request from the local computer. The service then doesn't try the password at all |
| “Diese Anmeldung hat keinen Zugang zur Datenbank des Alias.” (This login has no access to the alias's database.) | SQL Server accepted the login but didn't open the database (4060) |
| “Die Datenbank verweigert dieser Anmeldung den Vorgang.” (The database denies this login the operation.) | The login lacks a permission in SQL Server |
Resolution
- For the first message: use the service's
httpsaddress; if there's a proxy in front of it, register it underTrustedProxiesand have it reportX-Forwarded-Proto: https. - For the other two: give the login access or the missing permission in SQL Server.
Verification
The same request over https responds 200.
Related topics
en/wiki/data-conectivity/database-gateway/troubleshooting/sql-login-refused-with-403.txt · Last modified: by Wolfgang van der Stille