Introduction to JWT & OAuth2 for Secure APIs
A beginner's quiz on understanding JWT and OAuth2 for enhancing API security.
Questions in this quiz
15 questions on Introduction to JWT & OAuth2 for Secure APIs. Work through them here, then start the quiz to answer them and see your score.
1.What does JWT stand for in the context of API security?
- AJSON Web Token
- BJavaScript Web Token
- CJava Web Technology
- DJava Web Token
2.Which part of a JWT contains the claims?
- AToken
- BPayload
- CHeader
- DSignature
3.What is the primary purpose of the OAuth2 protocol?
- ATo authorize access
- BTo log user actions
- CTo authenticate users
- DTo encrypt data
4.In OAuth2, what is a 'scope'?
- AA user role
- BA security protocol
- CA permission level
- DA type of token
5.Which component of a JWT ensures the integrity of the token?
- AIssuer
- BSignature
- CPayload
- DHeader
6.What is the typical format of a JWT?
- ABase64-encoded string
- BBinary
- CPlain text
- DXML
7.Which HTTP header is commonly used to send a JWT?
- AAccept
- BCookie
- CContent-Type
- DAuthorization
8.What is the role of the 'Authorization Server' in OAuth2?
- ATo issue tokens
- BTo store user data
- CTo manage sessions
- DTo encrypt data
9.What is a common method for verifying the authenticity of a JWT?
- AChecking the payload
- BUsing a secret key
- CInspecting the issuer
- DReading the header
10.In OAuth2, what is an 'Access Token' used for?
- ATo authenticate users
- BTo store user preferences
- CTo authorize API requests
- DTo encrypt data
11.What is the purpose of the 'refresh token' in OAuth2?
- ATo obtain a new access token
- BTo verify user identity
- CTo refresh user data
- DTo reset user password
12.Which of the following is NOT a typical claim in a JWT?
- Asub (subject)
- Bexp (expiration)
- Ciss (issuer)
- Denc (encryption)
13.What does the 'Bearer' keyword indicate in an Authorization header?
- AThe type of token
- BThe token's signature
- CThe token's expiration
- DThe token's issuer
14.Which of the following is a benefit of using JWTs for API security?
- AThey are encrypted
- BThey are self-contained
- CThey are always valid
- DThey are user-specific
15.What is the typical expiration time for an access token in OAuth2?
- A1 minute
- B1 day
- C1 week
- D1 hour