Skip to content

add URL parameter authentication support#1464

Open
tantara wants to merge 2 commits into
tsl0922:mainfrom
tantara:feature/url-param-auth
Open

add URL parameter authentication support#1464
tantara wants to merge 2 commits into
tsl0922:mainfrom
tantara:feature/url-param-auth

Conversation

@tantara
Copy link
Copy Markdown

@tantara tantara commented Aug 18, 2025

Summary

Allow authentication via URL parameter as an alternative to HTTP Basic Auth header. This enables authentication in scenarios where headers cannot be easily set.

Background

I'm building a react library react-ttyd to integrate ttyd with react applications. Since browser doesn't allow to update header with WebSocket, I parse and verify credential from url parameters.

Example

ttyd --writable --credential testuser:testpw bash
socket = new WebSocket("http://localhost:7681/ws?authorization=${btoa('testuser:testpw')}", ["tty"]);
curl -X POST "http://localhost:7681/token?authorization=dGVzdHVzZXI6dGVzdHB3"
or 
curl -X POST  -H "Authorization: Basic dGVzdHVzZXI6dGVzdHB3" "http://localhost:7681/token"

claude added 2 commits August 17, 2025 21:32
Allow authentication via URL parameter as an alternative to HTTP Basic Auth header.
This enables authentication in scenarios where headers cannot be easily set.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Correct the return value check for lws_get_urlarg_by_name to properly
detect when the parameter is present.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@tsl0922 tsl0922 force-pushed the main branch 4 times, most recently from ee05f21 to a9b2d19 Compare March 20, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants