Valid characters in authorization token
The specifications are really hard to read, but as I understand it, the token can contain any of the following ASCII characters:
Char Dec Col/Row Oct Hex Name and Description (!) 33 02/01 41 21 EXCLAMATION MARK (
The following may also be included, but they must be enclosed in quotation marks:
Char Dec Col/Row Oct Hex Name and Description 9 00/09 11 09 HT (Ctrl-I) HORIZONTAL TAB 10 00/10 12 0A LF (Ctrl-J) LINE FEED 13 00/13 15 0D CR (Ctrl-M) CARRIAGE RETURN ( ) 32 02/00 40 20 SPACE (") 34 02/02 42 22 QUOTATION MARK (() 40 02/08 50 28 LEFT PARENTHESIS ()) 41 02/09 51 29 RIGHT PARENTHESIS (,) 44 02/12 54 2C COMMA (/) 47 02/15 57 2F SOLIDUS, SLASH (:) 58 03/10 72 3A COLON (;) 59 03/11 73 3B SEMICOLON (<) 60 03/12 74 3C LESS-THAN SIGN, LEFT ANGLE BRACKET (=) 61 03/13 75 3D EQUALS SIGN (>) 62 03/14 76 3E GREATER-THAN SIGN, RIGHT ANGLE BRACKET (?) 63 03/15 77 3F QUESTION MARK (@) 64 04/00 100 40 COMMERCIAL AT SIGN ([) 91 05/11 133 5B LEFT SQUARE BRACKET (\) 92 05/12 134 5C REVERSE SOLIDUS (BACKSLASH) (]) 93 05/13 135 5D RIGHT SQUARE BRACKET ({) 123 07/11 173 7B LEFT CURLY BRACKET, LEFT BRACE (}) 125 07/13 175 7D RIGHT CURLY BRACKET, RIGHT BRACE
Columns and formatting are taken from here .
Speculation
Here are the docs :
Many HTTP / 1.1 header field values consist of words separated by LWS [carriage return, line feed, space, horizontal tab] or special characters. These special characters MUST be enclosed in quotation marks for use in a parameter value (as defined in section 3.6 ).
token = 1*<any CHAR except CTLs or separators> separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT
Notes
- Base64 and Base64Url are subsets of the above character set, so if in doubt, you can always encode your Authentication header with one of them.
- Thanks to @CodeCaster for pointing me in the right direction.
Suragch May 20 '19 at 16:46 2019-05-20 16:46
source share