========================================================================== jwt-auth-demo - built-in resource server profiles: hs256,resourceserver ========================================================================== -------------------------------------------------------------------------- # 1. The filter chain. Note BearerTokenAuthenticationFilter in place of our # hand-written JwtAuthenticationFilter - same slot, framework-owned. HTTP 200 [ { "matchesThisRequest": true, "filters": [ "DisableEncodeUrlFilter", "WebAsyncManagerIntegrationFilter", "SecurityContextHolderFilter", "HeaderWriterFilter", "LogoutFilter", "OAuth2ProtectedResourceMetadataFilter", -------------------------------------------------------------------------- # 2. Access token -> 200. HTTP 200 { "name": "alice", "authorities": [ "FACTOR_BEARER", "ROLE_USER", "SCOPE_profile:read" ], "authenticationType": "JwtAuthenticationToken", "jti": "5dc2e769-9413-44e4-9bcb-6ab9fe1f6b2e", "issuer": "https://jwt-auth-demo.ankurm.com", -------------------------------------------------------------------------- # 3. Non-admin on an admin route -> 403 insufficient_scope. HTTP 403 WWW-Authenticate: Bearer error="insufficient_scope", error_description="The request requires higher privileges than provided by the access token.", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1" -------------------------------------------------------------------------- # 4. REFRESH token presented as an access token. # This is the line to watch when comparing the two runs. HTTP 200 { "name": "alice", "authorities": [ "FACTOR_BEARER" ], "authenticationType": "JwtAuthenticationToken", "jti": "8e069702-70a3-4029-89e8-d03c8b3e01ce", "issuer": "https://jwt-auth-demo.ankurm.com", "audience": [ "jwt-auth-demo-api" -------------------------------------------------------------------------- # end