Skip to content

refactor: use Spring Security's resource server #165

Closed

Description

@uniqueg

Why

spring-security-oauth2 and spring-security-oauth2-autoconfigure are end
of life and don't run on Spring Security 6 or 7. Spring Security 5.8 (used
now) has the resource server support that replaces them, so the switch can
happen on Spring Boot 2.7, before the framework moves.

How

  • Replace @EnableResourceServer/ResourceServerConfigurerAdapter
    (ResourceServerConfiguration) with a SecurityFilterChain using
    oauth2ResourceServer().opaqueToken(), with an OpaqueTokenIntrospector
    that validates tokens at the user info endpoint, as now.
  • Keep the behaviour exactly: the same principal (User, built by
    ElixirPrincipalExtractor), group authorities (GroupNamesSecurityExtractor,
    group prefix), claim authorisation (tesk.api.authorisation.claim),
    service-client JWTs checked locally (ServiceClientTokenServices, feat(auth): accept tokens of allow-listed clients #154),
    public paths (service-info unless TESK_API_SERVICE_INFO_PUBLIC=false,
    API description, Swagger UI), and the JSON error responses and
    WWW-Authenticate headers of CustomAuthenticationEntryPoint.
  • Keep SECURITY_OAUTH2_RESOURCE_USER_INFO_URI
    (security.oauth2.resource.user-info-uri) working; if a new key is added,
    the old one stays as a fallback and the docs say so.
  • The existing integration tests (AuthIT, ClaimAuthIT,
    ServiceClientAuthIT, NoAuthIT, ServiceInfoTokenRequiredIT,
    SwaggerUi*AuthIT, LegacyUserLabelsIT) are the contract: they pass
    unchanged, apart from imports of removed classes.
  • Remove both dependencies and the spring-security-oauth2 pin; docs
    (access control, configuration) updated.

Acceptance criteria

  • No org.springframework.security.oauth artifacts in the build.
  • All auth integration tests pass unchanged; the smoke test (401 without a
    token, public service-info) passes.
  • Docs updated; no configuration change needed for existing deployments.

Part of #66.

Activity

  1. added
    priority: medium
    status: blocked
    type: auth
    workload: days
    on Nov 13, 2026
  2. added
    status: triage
    status: in progress
    and removed
    status: blocked
    status: triage
    on Nov 13, 2026
  3. self-assigned this
    on Nov 13, 2026
  4. moved this from Backlog to In progress in ELIXIR On-Cloudon Nov 13, 2026
  5. moved this from In progress to In review in ELIXIR On-Cloudon Nov 14, 2026
  6. moved this from In review to Done in ELIXIR On-Cloudon Nov 14, 2026
  7. removed
    status: in progress
    on Nov 14, 2026
  8. added this to the v2.0.0 milestone on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: mediumtype: authworkload: days

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions