-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
With Coder becoming an OAuth provider, there is an opportunity to replace the existing copy-paste token authentication with a smoother experience.
Issues with Token Auth
- Longer default token lifetimes due to lack of refresh, which means more risk of abuse - a stolen token remains valid for a longer period of time, while real-time revocation becomes far more difficult (requires a server-side blacklist that must be maintained)
- If tokens are leaked, potential for widespread damage is higher - because tokens are stateless and self-contained, the validating server does not check with a database for verification
- Requires more user input and changes of context (redirection to a browser page, copy the token to the clipboard, paste it into the original context) which results in a heavier UX
Suggested Flow
- Once the user chooses to Login, they get directed to the following page.

- Upon entering the URL, a browser page will open and prompt the user to log in to their Coder account.
- Offer an optional link with text to the effect of, “Can’t authenticate? Generate a token” that will reload the page with a generated token if clicked.
- If this link is clicked, the remainder of the flow will return to the token authentication experience (i.e. IDE will prompt for the token to be pasted.)
- In the next prompt, the Coder IDE extension requests access to act on their behalf. The user clicks Grant app access.
- When authentication is successfully completed, a confirmation message appears. The user closes the browser window and returns to the IDE.
- The IDE reads and saves authentication on the user’s local machine.
The scope of permissions given to the API key for IDE clients will shrink for security reasons. They are:
- read workspaces
- read templates, templateversions, buildinfo
- read/write workspace agents + apps
- read your own user details
- authentication
- read access to SSH keys
- connect to workspace agents and show their resources (proxy through Coder CLI, depends on CLI's requested scopes)
Metadata
Metadata
Assignees
Labels
No labels