httpauth.abnf 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;
  3. ; HTTP digest authentication (2617) - ABNF
  4. ;
  5. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6. ;;;; 1.2 Access Authentication Framework
  7. auth-scheme = token
  8. auth-param = token "=" ( token | quoted-string )
  9. challenge = auth-scheme 1*SP 1#auth-param
  10. realm = "realm" "=" realm-value
  11. realm-value = quoted-string
  12. ;;;; 2 Basic Authentication Scheme
  13. challenge = "Basic" realm
  14. credentials = "Basic" basic-credentials
  15. basic-credentials = base64-user-pass
  16. base64-user-pass = token ;<base64 [4] encoding of user-pass, except not limited to 76 char/line>
  17. user-pass = userid ":" password
  18. userid = *TEXT ;*<TEXT excluding ":">
  19. password = *TEXT
  20. ;;;; 3.2.1 The WWW-Authenticate Response Header
  21. challenge = "Digest" digest-challenge
  22. digest-challenge = 1#( realm | [ domain ] | nonce | [ opaque ] |[ stale ] | [ algorithm ] | [ qop-options ] | [auth-param] )
  23. domain = "domain" "=" <"> URI ( 1*SP URI ) <">
  24. URI = absoluteURI | abs_path
  25. nonce = "nonce" "=" nonce-value
  26. nonce-value = quoted-string
  27. opaque = "opaque" "=" quoted-string
  28. stale = "stale" "=" ( "true" | "false" )
  29. algorithm = "algorithm" "=" ( "MD5" | "MD5-sess" | token )
  30. qop-options = "qop" "=" <"> 1#qop-value <">
  31. qop-value = "auth" | "auth-int" | token
  32. ;;;; 3.2.2 The Authorization Request Header
  33. credentials = "Digest" digest-response
  34. digest-response = 1#( username | realm | nonce | digest-url | response | [ algorithm ] | [cnonce] | [opaque] | [message-qop] | [nonce-count] | [auth-param] )
  35. username = "username" "=" username-value
  36. username-value = quoted-string
  37. digest-url = "url" "=" digest-url-value
  38. digest-url-value = request-url ; As specified by HTTP/1.1
  39. message-qop = "qop" "=" qop-value
  40. cnonce = "cnonce" "=" cnonce-value
  41. cnonce-value = nonce-value
  42. nonce-count = "nc" "=" nc-value
  43. nc-value = 8LHEX
  44. response = "response" "=" request-digest
  45. request-digest = DQUOTE 32LHEX DQUOTE
  46. LHEX = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f"
  47. ;;;; 3.2.3 The Authentication-Info Header
  48. AuthenticationInfo = "Authentication-Info" ":" auth-info
  49. auth-info = 1#(nextnonce | [ message-qop ] | [ response-auth ] | [ cnonce ] | [nonce-count] )
  50. nextnonce = "nextnonce" "=" nonce-value
  51. response-auth = "rspauth" "=" response-digest
  52. response-digest = DQUOTE *LHEX DQUOTE