Skip to content

OAuth Authentication Fails for Azure SQL Server in Go (go-mssqldb) #806

Open
@rpgohate-tibco

Description

Description:
I'm attempting to implement OAuth authentication for an Azure SQL Server database using the go-mssqldb driver. I have the following details:

Client ID
Client Secret
Tenant ID

I have successfully retrieved the access token using these credentials, but when I run the program, I encounter the following error:

2024/09/10 15:06:13 Error pinging the database: mssql: login error: Login failed for user ''.
exit status 1
It seems like the user information is either missing or not being properly set.

My Setup:
Go version: go1.20.4 linux/amd64
go-mssqldb version: v1.7.2
OAuth flow: Using client credentials (client ID, secret, tenant ID).
Question:
Does the go-mssqldb driver support OAuth authentication for Azure SQL Server?
If yes, am I missing any specific configuration steps?
How should I correctly pass the OAuth token for authentication?
Any help or guidance would be appreciated!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions