summaryrefslogtreecommitdiffstats
path: root/tinyHTTP/abnf/httpauth.abnf
blob: 1c4fe972dcf982ec1c00b58171a8cc0d9a4c975f (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; HTTP digest authentication (2617) - ABNF
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;; 1.2 Access Authentication Framework
auth-scheme    = token
auth-param     = token "=" ( token | quoted-string )

challenge   = auth-scheme 1*SP 1#auth-param

realm       = "realm" "=" realm-value
realm-value = quoted-string

;;;; 2 Basic Authentication Scheme
challenge   = "Basic" realm
credentials = "Basic" basic-credentials

basic-credentials = base64-user-pass
base64-user-pass  = token ;<base64 [4] encoding of user-pass, except not limited to 76 char/line>
user-pass   = userid ":" password
userid      = *TEXT ;*<TEXT excluding ":">
password    = *TEXT

;;;; 3.2.1 The WWW-Authenticate Response Header
challenge        =  "Digest" digest-challenge

digest-challenge  = 1#( realm | [ domain ] | nonce | [ opaque ] |[ stale ] | [ algorithm ] | [ qop-options ] | [auth-param] )

domain            = "domain" "=" <"> URI ( 1*SP URI ) <">
URI               = absoluteURI | abs_path
nonce             = "nonce" "=" nonce-value
nonce-value       = quoted-string
opaque            = "opaque" "=" quoted-string
stale             = "stale" "=" ( "true" | "false" )
algorithm         = "algorithm" "=" ( "MD5" | "MD5-sess" | token )
qop-options       = "qop" "=" <"> 1#qop-value <">
qop-value         = "auth" | "auth-int" | token


;;;; 3.2.2 The Authorization Request Header
credentials      = "Digest" digest-response
digest-response  = 1#( username | realm | nonce | digest-url | response | [ algorithm ] | [cnonce] | [opaque] | [message-qop] | [nonce-count]  | [auth-param] )

username         = "username" "=" username-value
username-value   = quoted-string
digest-url       = "url" "=" digest-url-value
digest-url-value = request-url   ; As specified by HTTP/1.1
message-qop      = "qop" "=" qop-value
cnonce           = "cnonce" "=" cnonce-value
cnonce-value     = nonce-value
nonce-count      = "nc" "=" nc-value
nc-value         = 8LHEX
response         = "response" "=" request-digest
request-digest   = DQUOTE 32LHEX DQUOTE
LHEX             = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f"


;;;; 3.2.3 The Authentication-Info Header
AuthenticationInfo = "Authentication-Info" ":" auth-info
auth-info          = 1#(nextnonce | [ message-qop ] | [ response-auth ] | [ cnonce ] | [nonce-count] )
nextnonce          = "nextnonce" "=" nonce-value
response-auth      = "rspauth" "=" response-digest
response-digest    = DQUOTE *LHEX DQUOTE

OpenPOWER on IntegriCloud