-
Notifications
You must be signed in to change notification settings - Fork 71
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
azureFedAuthConfig produces malformed access token scopes #197
Comments
Sigh. it'd sure be nice if the backend services were consistent. go-sqlcmd -G works fine with some fabric native endpoints, just not that one. |
For reference, the equivalent code in the C# SQL-Client SDK does not trim the trailing slash: string scope = parameters.Resource.EndsWith(s_defaultScopeSuffix, StringComparison.Ordinal) ? parameters.Resource : parameters.Resource + s_defaultScopeSuffix; This is in It seems like the SPN returned from the TDS endpoint for Fabric is "https://database.windows.net/" (but to be clear I'm pretty far out of my depth at this point). Thanks for opening this issue @chlowell! I appreciate you getting me pointed in the right direction. |
I wish I could remember what was in my head 3 years ago. Not sure why |
azureFedAuthConfig.azureFedAuthConfig
trims trailing/
from the given audience before appending the default scope/.default
:go-mssqldb/azuread/configuration.go
Lines 175 to 177 in ada30cb
This is incorrect in general because the default scope for a given audience is
audience + /.default
regardless of whetheraudience
has a trailing/
; see the Entra doc on this point. Removing trailing slashes makes it impossible for a downstream authentication client to reliably convert the resulting scope to a valid v1 resource string, which can cause authentication failures as seen in Azure/azure-sdk-for-go#22957The text was updated successfully, but these errors were encountered: