GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — fix: surface the token-exchange error instead of KeyError('access_token') by TangoEnSkai · Pull Request #928 · databricks/databricks-sql-python ConversationContext
When the exchange endpoint refuses, it replies with an OAuth error body The endpoint's own What
The response carries no token on the failure paths, so nothing sensitive is WhyThis is diagnostic only — the fallback to the external token works and queries Completion Criteria
close #904
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…en')
When token federation exchange fails, `_exchange_token` read
`token_response["access_token"]` unconditionally. An OAuth error body
(`{"error": ..., "error_description": ...}`) therefore raised
`KeyError('access_token')`, and the handler in `_get_token` logged the
name of the missing key:
Token exchange failed, using external token: 'access_token'
The endpoint's own reason was never read. Since `TokenFederationProvider`
wraps every provider and `_should_exchange_token` returns True whenever
the issuer host differs from the workspace host, this warning fires on
every connection for cross-issuer tokens with no way to tell whether the
exchange was misconfigured, unauthorized, or unsupported.
Check for `access_token` before reading it and raise a ValueError that
names the endpoint, the HTTP status, and the returned `error` /
`error_description`. A non-JSON body now reports the endpoint and status
rather than surfacing a JSONDecodeError. The response carries no token in
either case, so nothing sensitive is exposed.
The fallback to the external token is unchanged: `_get_token` still
catches the exception and connections keep working.
Resolves databricks#904
Signed-off-by: TangoEnSkai <[email protected]>
TangoEnSkai
force-pushed
the
fix/token-exchange-error-message
branch
from
5c96d89 to
3265132
Compare
Signed-off-by: TangoEnSkai <[email protected]>
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
jay-xiao446
approved these changes
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lgtm
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. This branch has not been deployedNo deployments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Token federation:_exchange_token raises KeyError('access_token') on error responses, discarding the real failure reason
Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |