Authentication Examples
Explore two different authentication methods using Cloudflare Workers and SvelteKit
Header Authentication
Header-basedUse the X-Custom-PSK header with a pre-shared key for authentication.
Example Request
curl -H "X-Custom-PSK: $HEADER_AUTH_VALUE" \
http://localhost:5173/api/protectedBasic Authentication
HTTP BasicUse standard HTTP Basic Authentication with username and password.
Example Request
curl -u $BASIC_AUTH_USERNAME:$BASIC_AUTH_PASSWORD \
http://localhost:5173/api/protectedAuthentication Response
Loading...