Skip to content

fix: sign in over HTTPS when the server requires it - #1932

Open
ranjithguggilla wants to merge 1 commit into
tableau:developmentfrom
ranjithguggilla:fix/1091-signin-requires-https
Open

ranjithguggilla wants to merge 1 commit into
tableau:developmentfrom
ranjithguggilla:fix/1091-signin-requires-https

Conversation

@ranjithguggilla

Copy link
Copy Markdown

Closes #1091

Motivation

Signing in to an http:// address when the server requires https fails with 405 Method Not Allowed, and the credentials have already been sent in cleartext. The issue asks the client to check the unauthenticated endpoint and switch to https before the sign-in request.

Behavior change

sign_in first GETs serverInfo with no credentials and without following redirects.

  • A redirect to https on the same host switches the stored server address, and the sign-in POST goes there.
  • An http response of 400, 403, or 405 is followed by the same GET over https. A 200 response switches the address.
  • A server that answers serverInfo over http is left on http.
  • If the probe cannot be made, sign-in continues at the address the caller gave.

Test plan

Three mocked cases: a 301 to https, a 200 over http, and a 405 on http with a 200 on https. test/test_auth.py and test/test_redirect_handling.py pass.

Not covered: a live server that redirects http to https.

An http sign-in against a server that only accepts https fails with 405
after the credentials have already been sent. Probe the unauthenticated
serverInfo endpoint first and switch the address to https when that
probe redirects or when http is refused and https answers.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Type 3] Don't let signin requests be sent if they use http when server expects https

1 participant