rrezartprebreza/spring-boot-skills / skills/spring-boot-4/oauth2-resource-server
oauth2-resource-server
VerifiedUse when configuring Spring Boot as an OAuth2 resource server, validating JWTs from an external auth provider (Keycloak, Auth0, Okta, Cognito), extracting claims, or implementing scope-based authorization.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.3 KB |
| agents/openai.yaml | config | 207 B |
| examples/bad-resource-server-config.java | other | 2.1 KB |
| examples/good-resource-server-config.java | other | 1.6 KB |
| templates/ExternalIdentity.java | other | 751 B |
| templates/JwtClaimExtractor.java | other | 2.2 KB |
| templates/ResourceServerConfig.java | other | 3.3 KB |
templates/ExternalIdentity.java
View on GitHubpackage com.example.config;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.oauth2.jwt.Jwt;
/** Account key from an already verified access token, not a token validator. */
public record ExternalIdentity(String issuer, String subject) {
public ExternalIdentity {
if (issuer == null || issuer.isBlank() || subject == null || subject.isBlank()) {
throw new BadCredentialsException("Issuer and subject are required");
}
}
public static ExternalIdentity from(Jwt jwt) {
// Preserve exact issuer and opaque subject; do not lowercase or trim either.
return new ExternalIdentity(jwt.getClaimAsString("iss"), jwt.getSubject());
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |