nerdexam
Cisco

300-435 · Question #139

Refer to the exhibit. An engineer is tasked to configure a Cisco IOS-XE router using restconf. The base64 code Cisco IOS-XE router uses is 1A2B3C4D5E6F7G8H910. Which line of code must be added to…

The correct answer is A. 'Authorization': 'Basic 1A2B3C4D5E6F7G8H910'. This question tests knowledge of HTTP authentication headers, specifically for RESTCONF APIs on Cisco IOS-XE, which commonly use Basic Authentication.

Device-Level Network Automation

Question

Refer to the exhibit. An engineer is tasked to configure a Cisco IOS-XE router using restconf. The base64 code Cisco IOS-XE router uses is 1A2B3C4D5E6F7G8H910. Which line of code must be added to the box where the code is missing to complete the Python request?

Options

  • A'Authorization': 'Basic 1A2B3C4D5E6F7G8H910'
  • B'X-XSRF-TOKEN': '1A2B3C4D5E6F7G8H910'
  • C'secure-token': '1A2B3C4D5E6F7G8H910'
  • D'x-auth-token': '1A2B3C4D5E6F7G8H910'

How the community answered

(26 responses)
  • A
    88% (23)
  • B
    8% (2)
  • D
    4% (1)

Why each option

This question tests knowledge of HTTP authentication headers, specifically for RESTCONF APIs on Cisco IOS-XE, which commonly use Basic Authentication.

A'Authorization': 'Basic 1A2B3C4D5E6F7G8H910'Correct

RESTCONF APIs on Cisco IOS-XE often utilize HTTP Basic Authentication for secure access, where the username and password (or a token derived from them) are base64-encoded and sent in the 'Authorization' header with the 'Basic' scheme. Therefore, 'Authorization': 'Basic 1A2B3C4D5E6F7G8H910' correctly formats the header.

B'X-XSRF-TOKEN': '1A2B3C4D5E6F7G8H910'

'X-XSRF-TOKEN' is an HTTP header used for Cross-Site Request Forgery (XSRF) protection, a different security mechanism not typically used for basic authentication with base64-encoded credentials.

C'secure-token': '1A2B3C4D5E6F7G8H910'

'secure-token' is not a standard or commonly recognized HTTP header for authentication in the context of RESTCONF on Cisco IOS-XE.

D'x-auth-token': '1A2B3C4D5E6F7G8H910'

'x-auth-token' is a custom header often used for token-based authentication, but for a base64-encoded credential described as 'code', Basic Authentication is the standard and most fitting method.

Concept tested: RESTCONF authentication, HTTP Basic Auth

Source: https://developer.cisco.com/docs/ios-xe/#!restconf-developer-guide/restconf-api

Topics

#RESTCONF#HTTP Authentication#IOS-XE#Python Requests

Community Discussion

No community discussion yet for this question.

Full 300-435 Practice