-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_auth.sh
More file actions
27 lines (20 loc) · 1004 Bytes
/
test_auth.sh
File metadata and controls
27 lines (20 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
echo "Testing gURL Authentication Features"
echo "==================================="
echo
echo "1. Testing Basic Authentication (with --basic flag):"
./gURL GET https://httpbin.org/basic-auth/user/pass --basic --user user:pass
echo
echo "2. Testing Basic Authentication (default, no auth type specified):"
./gURL GET https://httpbin.org/basic-auth/user/pass --user user:pass
echo
echo "3. Testing invalid credentials (should fail with 401):"
./gURL GET https://httpbin.org/basic-auth/user/pass --basic --user wrong:password
echo
echo "4. Testing that auth headers are properly sent (using GET endpoint that echoes headers):"
./gURL GET https://httpbin.org/get --basic --user testuser:testpass | grep -A 10 '"headers"'
echo
echo "5. Testing digest authentication flag (will show 401 with digest challenge - full digest auth requires challenge-response):"
./gURL GET https://httpbin.org/digest-auth/auth/user/pass --digest --user user:pass
echo
echo "Authentication testing complete!"