A developer has completed the implementation of a REST API, but when it is executed, it returns a 401 error message. What must be done on the API to resolve the issue?
A.
Access permission to the resource must be granted, before the request.
B.
Configure new valid credentials.
C.
The requested API endpoint does not exist, and the request URL must be changed.
D.
Additional permission must be granted before the request can submitted.
B
401 Unauthorized: Authentication is required (API key, API token, or
username and password). If the API was previously accessible, be
aware that keys and tokens can expire, and usernames and passwords
can be changed.
- 403 Forbidden: You are authenticated and authorized but do not have
the permission to access the resource.
Very confusing question:
If the request included authentication credentials, then the 401
response indicates that authorization has been refused for those
credentials. The user agent MAY repeat the request with a new or
replaced Authorization header field (Section 4.2). If the 401
response contains the same challenge as the prior response, and the
user agent has already attempted authentication at least once, then
the user agent SHOULD present the enclosed representation to the
user, since it usually contains relevant diagnostic information.
Answer is B
401 Unauthorized: Authentication is required (API key, API token, or username and password).
If the API was previously accessible, be aware that keys and tokens can expire, and usernames
and passwords can be changed
I would go with B but it's a weird question as you do not know if additional rights are needed. It can be that the account works but needs additional rights configuring new credentials will not solve the issue if the underlaying issue isn't resolved.
Again a great Cisco exam question.
"The HTTP 401 Unauthorized client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for the target resource.
This status is sent with a WWW-Authenticate header that contains information on how to authorize correctly.
This status is similar to 403, but in this case, authentication is possible."
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401
401 Unauthorized
The request requires user authentication.
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
newtoaws
Highly Voted 3 years agoTechBrain
Highly Voted 2 years, 6 months agorouteswitch
Most Recent 3 days, 20 hours agoTeringzooi
8 months, 3 weeks agodesignated
10 months, 3 weeks agoQuiShong
12 months agoferock
1 year, 1 month ago__al__
1 year, 2 months ago__al__
1 year, 2 months agorhmgh
1 year, 4 months agogarcesdavid88
1 year, 8 months agoNpirate
1 year, 10 months agosan111
2 years, 8 months agoFR99
2 years, 9 months agoFR99
2 years, 9 months agoFR99
2 years, 11 months ago