spring-oauth2-resource-serverlisted
Install: claude install-skill hcussi/claude-code-toolkit
# spring-oauth2-resource-server
Wire a Spring Boot application to accept and validate OAuth2/OIDC JWT access
tokens (resource-server role). This covers protecting an API with bearer tokens.
It does not configure the login/authorization-code flow (that is the client
role) or opaque-token introspection.
Provider-agnostic: it is driven entirely by an `issuer-uri`, so it works with
Keycloak, Auth0, Okta, Cognito, Entra ID, or any OIDC-compliant authorization
server.
## Before you start
Discover the target project's shape rather than assuming it (use Glob/Grep):
- **Build tool**: `build.gradle` / `build.gradle.kts` vs `pom.xml`, and whether
Gradle uses a version catalog (`gradle/libs.versions.toml`).
- **Spring Boot version**: read it from the build file. It changes two test
imports (see `references/dependencies.md`).
- **Base package**: the package under `src/main/java/...` holding the main
`@SpringBootApplication` class. New classes go in a `config` subpackage of it.
- **Config format**: `application.yml` vs `application.properties`.
Then gather the values to plug in:
- **issuer-uri**: the OIDC issuer base URL.
- **audience**: the value expected in the token's `aud` claim (usually the API's
client id / identifier).
- **allowed CORS origins**: the browser origins that call this API.
## Steps
Reference files live in this skill's `references/` directory. Copy them into the
project, then substitute `com.example.app` with the real base package and adjust
placeholders