Skip to content

[QUESTION] Windows Authentication for User not Logged In #413

Open
@ccowin-odhsoha

Description

@ccowin-odhsoha

Question
Hello, I'm looking for some guidance on if what I'm doing is possible and I'm just doing it wrong or if it is not possible. I have two accounts one for my local machine and another for my server. Neither can log into the other machine, The desktop user is also the owner of the SQL database and table that I'm trying to access. I thought it would be possible to provide the username and password of the desktop user within the settings.py but I keep getting the following error:

django.db.utils.InterfaceError: ('28000', "[28000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Login failed for user 'DHS\\OR0270734'. (18456) (SQLDriverConnect); [28000] [Microsoft][ODBC Driver 18 for SQL Server]Invalid connection string attribute (0); [28000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Login failed for user '{domain}//{username}'. (18456); [28000] [Microsoft][ODBC Driver 18 for SQL Server]Invalid connection string attribute (0)"

From settings:

DATABASES = {
    "default": {
        "ENGINE": "mssql",
        "NAME": 'GIS',
        "USER": '{domain}//{username}',
        "PASSWORD": '{password}',
        "HOST": 'WPDHSSQLL36\PRODI2',
        "OPTIONS": {
            'driver': 'ODBC Driver 18 for SQL Server'
        }
    }
}

I've also tried every format I can think of with the domain/username so that might be an issue. Tried both forward and backward slash with one and two slashes. Also tried the domain at the end separated by a @.

Relevant Issues and Pull Requests

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions