nerdexam
Cisco

200-901 · Question #149

A REST API service requires authentication based on the username and password. The user "john" has the password "384279060" and the Base64 encoding of those credentials is "am9objowMTIzNDU2Nzg="…

The correct answer is D. The header must include. HTTP Basic Authentication requires Base64-encoded credentials to be transmitted in the Authorization request header, not in the request body. The correct format is 'Authorization: Basic <base64-encoded-credentials>'.

Understanding and Using APIs

Question

A REST API service requires authentication based on the username and password. The user "john" has the password "384279060" and the Base64 encoding of those credentials is "am9objowMTIzNDU2Nzg=". Which method completes an authentication request?

Options

  • AThe header must include:
  • BThe payload must include:
  • CThe payload must include.
  • DThe header must include:

How the community answered

(46 responses)
  • A
    2% (1)
  • B
    4% (2)
  • C
    7% (3)
  • D
    87% (40)

Why each option

HTTP Basic Authentication requires Base64-encoded credentials to be transmitted in the Authorization request header, not in the request body. The correct format is 'Authorization: Basic <base64-encoded-credentials>'.

AThe header must include:

Although choice A references a header, it does not represent the correctly formatted or complete Authorization header required by the Basic Authentication scheme as defined in RFC 7617.

BThe payload must include:

HTTP Basic Authentication credentials must be transmitted in the Authorization request header, not in the request body payload; placing credentials in the body is not part of the Basic Auth scheme.

CThe payload must include.

HTTP Basic Authentication credentials must be transmitted in the Authorization request header, not in the request body; the Basic Auth scheme defined in RFC 7617 specifies header-based credential delivery exclusively.

DThe header must include:Correct

RFC 7617 defines HTTP Basic Authentication as requiring credentials to be placed in the Authorization HTTP request header using the 'Basic' scheme followed by the Base64-encoded 'username:password' string. For user 'john' with password '384279060', the correct header is 'Authorization: Basic am9objowMTIzNDU2Nzg=' - this must be a header, not a body payload.

Concept tested: HTTP Basic Authentication Authorization header format

Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#basic_authentication_scheme

Topics

#REST API#Authentication#HTTP Headers#HTTP Basic Authentication

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice