tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

authentication.py (462B)


      1 def main(request, response):
      2    user = request.auth.username
      3    password = request.auth.password
      4 
      5    if user == b"user" and password == b"password":
      6        return b"Authentication done"
      7 
      8    realm = b"test"
      9    if b"realm" in request.GET:
     10        realm = request.GET.first(b"realm")
     11 
     12    return ((401, b"Unauthorized"),
     13            [(b"WWW-Authenticate", b'Basic realm="' + realm + b'"')],
     14            b"Please login with credentials 'user' and 'password'")