nerdexam
CiscoCisco

300-910 · Question #79

300-910 Question #79: Real Exam Question with Answer & Explanation

Sign in or unlock 300-910 to reveal the answer and full explanation for question #79. The question stem and answer options stay visible for context.

Security

Question

An engineer is developing a script that must call an API using a static Bearer token. Which solution securely protects the credentials from being retrievable from the source code?

Options

  • A```python import os import requests def call_api(): result = requests.get( "https://example.api.com", headers={"Authorization": "Bearer " + os.getenv("TOKEN")}, ) result.raise_for_status() return result.json() ```
  • B```python import requests import base64 def call_api(): result = requests.get( "https://example.api.com", headers={"Authorization": "Bearer " + base64.b64decode(b"TXlZZWN yZXR0ZXN0dG9rZW4==").decode("utf-8") }, ) result.raise_for_status() return result.json() ```
  • C```python import requests def call_api(): result = requests.get( "https://example.api.com", headers={"Authorization": "Bearer MySecretToken"}, ) result.raise_for_status() return result.json() ```
  • D```python import requests from .password import token def call_api(): result = requests.get( "https://example.api.com", headers={"Authorization": "Bearer " + token}, ) result.raise_for_status() return result.json() ```

Unlock 300-910 to see the answer

You've previewed enough free 300-910 questions. Unlock 300-910 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#API security#Credential management#Environment variables#Secure coding practices
Full 300-910 PracticeBrowse All 300-910 Questions