vmware / vmware/pinniped

Safari users shouldn't need to always copy/paste the authcode on web-based login flows

Open
#998 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement priority/undecided
Dominant language
Go
Stars
739
Forks
85
Avg merge
5d 5h
Merged PRs (30d)
1

Description

Is your feature request related to a problem? Please describe.

There is an intentional behavior in Safari which is not spec-compliant which will always prevent an https (TLS) web site from making fetch calls to an http (non-TLS) localhost site (see the heated debate in https://bugs.webkit.org/show_bug.cgi?id=171934). So Safari always immediately fails our fetch request and our UI catches the failure and shows the authcode. Therefore, all Safari users always have to manually copy/paste the authcode to log in. This is regardless of cors or non-cors mode.

~20% of internet users use Safari, so this might be worth improving.

Describe the solution you'd like

The Concourse fly CLI’s similar web page works around this. When the automatic localhost call fails, then they show a new button in the UI “send token to fly directly”, and that button has an “a” tag with an “href” of the http localhost callback url with the token as a query param. This is allowed because it is following an href and loading a whole new page. We could add a similar feature.

Here is a screenshot of that UI from Concourse:

fly CLI UI Screen Shot

Describe alternatives you've considered

Not sure if anything else is possible. Maybe Safari someday adds the same CORS support for localhost requests that Chrome added in v98. If that happened then maybe the problem would go away in Safari. They don't seem to have announced any such plan on the bug report linked above, so that may never happen.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the web-based login flow where a failed localhost fetch causes the authcode to be shown, and trace the Safari failure handling. Compare the proposed fallback with the Concourse flow: done means offering a button whose link sends the token to the localhost callback URL, while preserving the existing manual copy/paste path.

Written by the indexing model from the issue text.

Assessment

Domain
authentication, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.