QuizzesSpring Security: Basics of OAuth2 Resource Server Setup
beginner
spring

Spring Security: Basics of OAuth2 Resource Server Setup

Learn the fundamentals of setting up an OAuth2 Resource Server with Spring Security.

15 minutes 15 questions Pass at 70%
Time Limit
15 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

15 questions on Spring Security: Basics of OAuth2 Resource Server Setup. Work through them here, then start the quiz to answer them and see your score.

  1. 1.What is the primary purpose of an OAuth2 Resource Server?

    • ATo protect APIs by validating tokens
    • BTo store user data
    • CTo authenticate users
    • DTo manage user sessions
  2. 2.Which Spring Boot starter is used to set up an OAuth2 Resource Server?

    • Aspring-boot-starter-oauth2-resource-server
    • Bspring-boot-starter-security
    • Cspring-boot-starter-web
    • Dspring-boot-starter-data-jpa
  3. 3.In Spring Security, which annotation is used to enable resource server functionality?

    • A@EnableOAuth2Client
    • B@EnableWebSecurity
    • C@EnableResourceServer
    • D@EnableOAuth2Sso
  4. 4.What configuration is necessary to specify the location of the public key for token validation?

    • Asecurity.oauth2.client.client-secret
    • Bsecurity.oauth2.client.client-id
    • Csecurity.oauth2.resource.token-info-uri
    • Dsecurity.oauth2.resource.jwt.key-uri
  5. 5.Which HTTP status code is returned when a request to a protected resource is unauthorized?

    • A200 OK
    • B403 Forbidden
    • C404 Not Found
    • D401 Unauthorized
  6. 6.What is the role of the JwtDecoder bean in a Spring Security OAuth2 Resource Server?

    • ATo decode and validate JWT tokens
    • BTo store user credentials
    • CTo manage user sessions
    • DTo encode JWT tokens
  7. 7.Which property is used to specify the issuer URI for token validation?

    • Aspring.security.oauth2.resourceserver.client-secret
    • Bspring.security.oauth2.resourceserver.client-id
    • Cspring.security.oauth2.resourceserver.token-uri
    • Dspring.security.oauth2.resourceserver.jwt.issuer-uri
  8. 8.What is the default token format expected by Spring Security OAuth2 Resource Server?

    • AOpaque token
    • BJWT
    • CXML
    • DSAML
  9. 9.Which method in the HttpSecurity configuration is used to specify that the application is a resource server?

    • Ahttp.oauth2ResourceServer()
    • Bhttp.oauth2Login()
    • Chttp.csrf()
    • Dhttp.formLogin()
  10. 10.What is the purpose of the Bearer token type in OAuth2?

    • ATo log user activities
    • BTo specify the type of token used for authentication
    • CTo manage user roles
    • DTo encrypt user passwords
  11. 11.Which dependency is required for JWT support in a Spring Security OAuth2 Resource Server?

    • Aspring-security-web
    • Bspring-security-jwt
    • Cspring-security-oauth2-jose
    • Dspring-security-core
  12. 12.What does the 'aud' claim in a JWT token represent?

    • ASubject of the token
    • BAudience for which the token is intended
    • CIssuer of the token
    • DExpiration time of the token
  13. 13.Which configuration property is used to enable JWT token validation in a Spring Security Resource Server?

    • Aspring.security.oauth2.resourceserver.jwt.jwk-set-uri
    • Bspring.security.oauth2.resourceserver.jwt.issuer-uri
    • Cspring.security.oauth2.resourceserver.opaque-token.introspection-uri
    • Dspring.security.oauth2.resourceserver.jwt.key-value
  14. 14.What is the purpose of the 'exp' claim in a JWT token?

    • ATo specify the token issuer
    • BTo list the token's audience
    • CTo define the token's expiration time
    • DTo identify the token's subject
  15. 15.Which of the following is NOT a standard claim in a JWT?

    • Apwd
    • Baud
    • Csub
    • Diss