HTTP Basic Authentication Parser
Decode strict Base64 Basic credentials as byte values and separate the first colon, leaving character-set interpretation to the caller.
Description
HTTP Basic credentials encode username and password bytes as Base64.
When to use HTTP Basic Authentication Parser
Use HTTP Basic Authentication Parser when you need to evaluate the supplied records under the calculation and evidence rules below. No UTF-8 or other charset interpretation, credential verification or encryption is performed. Leading header whitespace is rejected.
Paste the requested HTTP header field value. Use the field table to distinguish request cookies, media types and authorization credentials.
How to use HTTP Basic Authentication Parser and understand its results
- Paste the requested HTTP header field value. Use the field table to distinguish request cookies, media types and authorization credentials.
- Enter header using the field table and calculation rules, then run the tool.
- Read usernameBytes, passwordBytes. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| header | Authorization field value. | string; maximum length: 1000000 | Required |
Paste an Authorization field value starting case-insensitive Basic followed by spaces/tabs. Decode strict canonical Base64 with required padding and zero unused bits. Require a colon and reject control bytes below 32 or127. Split at first colon; return username/password byte arrays. Empty username/password are allowed; later colons belong to password.
decoded bytes split at first byte58 Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| usernameBytes | Username bytes. | list of integer; minimum: 0; maximum: 255; minimum entries: 0; maximum entries: 100000 |
| passwordBytes | Password bytes. | list of integer; minimum: 0; maximum: 255; minimum entries: 0; maximum entries: 100000 |
{
"input": {
"header": "Basic dXNlcjpwYXNz"
},
"output": {
"usernameBytes": [
117,
115,
101,
114
],
"passwordBytes": [
112,
97,
115,
115
]
}
} Limitations and assumptions
No UTF-8 or other charset interpretation, credential verification or encryption is performed. Leading header whitespace is rejected.
Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing fields without a declared default, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use HTTP Content-Type Parser: A Content-Type field identifies a media type plus optional parameters such as charset or boundary. Parameter name normalization must not alter parameter values. For a complementary task, use Base64 Decoder: Decode canonical Base64 into UTF-8 text.
Further background: RFC 7617: Basic HTTP Authentication Scheme.
References
Similar or alternative tools
- HTTP Content-Type Parser
A Content-Type field identifies a media type plus optional parameters such as charset or boundary. Parameter name normalization must not alter parameter values.
- Base64 Decoder
Decode canonical Base64 into UTF-8 text.