Module 29: Authentication
Check your understanding
A quick multiple-choice check before you move on. Answer every question, then submit to see how you did.
1.In Axum, how does a custom auth type built by implementing FromRequestParts prevent an unauthenticated request from reaching the handler body?
2.For a Authorization: Basic <base64> header, what is the correct order of operations to recover the username and password?
3.In the check_basic example, why does the function return Option<()> and use the ? operator throughout?
4.According to the theory, how should validation of a JWT bearer token differ from validating basic-auth credentials?
5.The theory contrasts Axum's approach with C#'s [Authorize] attribute and JWT bearer middleware. What is the closest Rust equivalent it describes?
Answer every question to submit.