Question 1
Which HTTP header is commonly used to transmit authentication credentials in the Basic Authentication scheme?
- Authorization
- Authentication
- Credentials
- Auth
- Authorisation
Question 2
What is the primary function of authorization in the context of API security?
- Verifying the identity of the user or application
- Determining what resources a user or application is allowed to access
- Encrypting sensitive data transmitted over the network
- Preventing denial-of-service attacks
- Monitoring API usage patterns
Question 3
In OAuth 2.0, what is the purpose of an 'access token'?
- To identify the user making the request
- To grant temporary access to protected resources on behalf of the user
- To verify the client application's identity
- To refresh an expired token
- To store user preferences
Question 4
Which of the following is a common vulnerability that can arise from improperly implemented authorization checks?
- SQL Injection
- Cross-Site Scripting (XSS)
- Insecure Direct Object Reference (IDOR)
- Denial of Service (DoS)
- Server-Side Request Forgery (SSRF)
Question 5
Which of the following authentication methods is generally considered the most secure for API endpoints?
- Basic Authentication
- API Keys in the query string
- OAuth 2.0 with Proof Key for Code Exchange (PKCE)
- Cookies
- Bearer Tokens stored in local storage
Question 6
What does the acronym JWT stand for in the context of API security?
- JSON Web Token
- Java Web Token
- JavaScript Web Token
- JSON Wrapper Token
- JSON World Token
Question 7
Which component of a JWT is used to verify the token's integrity and authenticity?
- Header
- Payload
- Signature
- Algorithm
- Key
Question 8
What is the purpose of Role-Based Access Control (RBAC) in API authorization?
- To define access permissions based on user roles
- To track user activity on the API
- To enforce rate limiting
- To encrypt data in transit
- To generate API documentation
Question 9
If an API endpoint requires both authentication and authorization, which should typically be performed first?
- Authentication
- Authorization
- They can be performed in any order
- Neither is necessary
- Both simultaneously
Question 10
What is a common practice to protect API keys from exposure?
- Hardcoding them directly in the client-side code
- Storing them in environment variables on the server-side
- Sending them in the URL query parameters
- Using Base64 encoding without encryption
- Sharing them publicly