Spring Boot Security: OAuth2 Resource Server Basics
An introductory quiz on configuring and understanding OAuth2 Resource Server in Spring Boot.
Questions in this quiz
15 questions on Spring Boot Security: OAuth2 Resource Server Basics. Work through them here, then start the quiz to answer them and see your score.
1.What is the primary purpose of an OAuth2 Resource Server in Spring Boot?
- ATo protect APIs by validating access tokens
- BTo handle database transactions
- CTo store user data
- DTo manage user authentication
2.Which Spring Boot dependency is required to set up an OAuth2 Resource Server?
- Aspring-boot-starter-data-jpa
- Bspring-boot-starter-security
- Cspring-boot-starter-web
- Dspring-boot-starter-oauth2-resource-server
3.In Spring Security, which annotation is used to enable resource server capabilities?
- A@EnableAuthorizationServer
- B@EnableResourceServer
- C@EnableOAuth2Client
- D@EnableWebSecurity
4.What is the default token format supported by Spring Security's OAuth2 Resource Server?
- AOpaque tokens
- BSAML tokens
- CXML tokens
- DJWT (JSON Web Tokens)
5.Which property is used to specify the JWK Set URI in application.properties?
- Aspring.security.oauth2.resourceserver.jwt.jwk-set-uri
- Bspring.security.oauth2.resourceserver.jwk-uri
- Cspring.security.oauth2.client.jwk-set-uri
- Dspring.security.oauth2.jwt.jwk-uri
6.What role does the 'Bearer' token type play in OAuth2?
- AIt identifies the client application
- BIt indicates the token is used for access
- CIt defines the token expiry
- DIt specifies the token format
7.How does an OAuth2 Resource Server validate a JWT token?
- ABy using a third-party service
- BBy comparing the token to a predefined list
- CBy verifying the token signature
- DBy checking the token against a database
8.Which HTTP header is commonly used to pass the access token to a resource server?
- AToken
- BAuthenticate
- CAuthorization
- DAccess-Token
9.What is the purpose of the 'scope' claim in a JWT token?
- ATo identify the token issuer
- BTo specify the token's intended audience
- CTo list the permissions granted by the token
- DTo define the token's expiration time
10.Which class is used to configure security for an OAuth2 Resource Server in Spring Boot?
- AWebSecurityConfigurerAdapter
- BSecurityConfigurerAdapter
- CResourceServerConfigurerAdapter
- DOAuth2ClientConfigurerAdapter
11.What does the 'aud' claim in a JWT token represent?
- AThe token's expiration time
- BThe token's subject
- CThe token issuer
- DThe token's intended audience
12.Which method is used to configure HTTP security in a Resource Server?
- Ainit(HttpSecurity http)
- Bconfigure(HttpSecurity http)
- Csetup(HttpSecurity http)
- Dsecure(HttpSecurity http)
13.What is the role of a JWK Set URI in an OAuth2 Resource Server?
- ATo provide public keys for token signature verification
- BTo manage user sessions
- CTo define API endpoints
- DTo store user credentials
14.Which claim in a JWT token specifies its expiration time?
- Anbf
- Bsub
- Cexp
- Diat
15.What does the 'sub' claim in a JWT token represent?
- AThe token issuer
- BThe token's scope
- CThe token's intended audience
- DThe token's subject or principal