/guicedee-jwt:guicedee-jwtfrom guicedee-jwt
Bridges Vert.x JWT authentication to MicroProfile JWT in Guiced, enabling claim injection via @Claim and request-scoped JsonWebToken propagation.
Ships in guicedee-jwt. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Bridges the MicroProfile JWT Auth specification to Vert.x 5 JWT authentication inside Guiced.
The module converts a Vert.x User (authenticated via JWTAuth) into an org.eclipse.microprofile.jwt.JsonWebToken, making all standard and custom JWT claims available through the MP JWT API. Claims can be injected directly using @Claim — no @Inject required.
Vert.x JWTAuth → User → VertxJsonWebToken (implements JsonWebToken)
↓
MicroProfileJwtContext (CallScope + ThreadLocal)
↓
MicroProfileJwtModule (Guice bindings)
↓
@Claim("sub") String subject ← injected per-request
guiced.net:jwt dependency.@JwtAuthOptions on package-info.java (from the auth module).@Claim to inject claims into your classes:
@Claim("sub")
private String subject;
@Claim("groups")
private Set<String> roles;
@Claim("exp")
private Long expiration;
@Inject
private JsonWebToken jwt;
module-info.java:
module my.app {
requires com.guicedee.microprofile.jwt;
opens my.app to com.google.guice;
}
VertxJsonWebTokenBridge from Vert.x User to MP JsonWebToken. Extracts claims from the User's principal() and accessToken attribute.
getName() resolves via MP JWT spec: upn → preferred_username → subgetGroups() maps from the groups claimgetAudience() handles both string and array formatsgetClaim(String) returns typed values, converting JsonArray → Set<String> and JsonObject → MapMicroProfileJwtContextRequest-scoped holder for the current JsonWebToken:
CallScopeProperties when a CallScope is active (Vert.x HTTP handlers)ThreadLocal when no call scope is active (unit tests, non-HTTP code)// Synchronous work inside an authenticated handler and active call scope:
JsonWebToken previous = MicroProfileJwtContext.getCurrent();
User user = routingContext.user(); // already authenticated by the owning boundary
MicroProfileJwtContext.setCurrent(new VertxJsonWebToken(user));
try {
// ... handle synchronous work ...
} finally {
MicroProfileJwtContext.setCurrent(previous); // null clears; nested work restores parent
}
Or use the convenience method:
MicroProfileJwtPreStartup.setCurrentUser(routingContext.user());
ClaimValueProvider<T>Guice Provider<T> that resolves a claim from the current JsonWebToken at injection time.
Claim fields capture the value when the object is injected; a singleton's field does not refresh per request. Use request/call-scoped objects or resolve current values inside the active scope. For asynchronous work, preserve that scope until completion and clean up on every terminal path; the synchronous try/finally example is not an asynchronous lifetime wrapper. A manually constructed User or context assignment is not token verification.
MicroProfileJwtModuleGuice module (auto-discovered via SPI) that:
JsonWebToken → MicroProfileJwtContext::getCurrent@Claim-annotated fields via ClassGraph@Named("claimName") bindings for each discovered claimSupported field types:
| Type | Example | Null/absent behavior |
|---|---|---|
String | @Claim("sub") String subject | null |
Set<String> | @Claim("groups") Set<String> roles | Set.of() |
Long / long | @Claim("exp") Long expiration | 0L |
Integer / int | @Claim("level") Integer level | 0 |
Boolean / boolean | @Claim("email_verified") Boolean verified | false |
Optional<String> | @Claim("sub") Optional<String> subject | Optional.empty() |
Object | @Claim("custom") Object data | null |
MicroProfileJwtPreStartupPre-startup hook that validates the JWT auth provider availability. Also provides:
MicroProfileJwtPreStartup.setCurrentUser(User user);
The module registers three Guice SPIs so @Claim works without @Inject:
| SPI | Implementation | Purpose |
|---|---|---|
InjectionPointProvider | ClaimInjectionPointProvider | Marks @Claim as injection point |
NamedAnnotationProvider | ClaimNamedAnnotationProvider | Converts @Claim("sub") → @Named("sub") |
BindingAnnotationProvider | ClaimBindingAnnotationProvider | Registers @Claim as binding annotation |
module com.guicedee.microprofile.jwt {
requires transitive com.guicedee.vertx;
requires transitive com.guicedee.guicedinjection;
requires transitive io.vertx.auth.jwt;
requires transitive microprofile.jwt.auth.api;
requires transitive jakarta.json;
exports com.guicedee.microprofile.jwt;
exports com.guicedee.microprofile.jwt.implementations;
provides IGuiceModule with MicroProfileJwtModule;
provides IGuicePreStartup with MicroProfileJwtPreStartup;
provides InjectionPointProvider with ClaimInjectionPointProvider;
provides NamedAnnotationProvider with ClaimNamedAnnotationProvider;
provides BindingAnnotationProvider with ClaimBindingAnnotationProvider;
}
When using Keycloak or any OIDC provider:
@JwtAuthOptions or @OAuth2Options for the provider.use=sig) to avoid RSA-OAEP encryption key errors.JWTAuthOptions.addJwk(JsonObject) for JWKS JSON keys (not PubSecKeyOptions).Keycloak JWTs include preferred_username, realm_access, resource_access, email, given_name, family_name as standard claims — all accessible via getClaim().
IGuiceContext.instance().inject()
└─ MicroProfileJwtPreStartup (validates JWT provider availability)
└─ MicroProfileJwtModule (Guice bindings)
├─ Binds JsonWebToken → MicroProfileJwtContext::getCurrent
├─ Scans @Claim-annotated fields via ClassGraph
└─ Creates per-type @Named("claimName") providers
└─ HTTP Request arrives
├─ Auth handler authenticates → User
├─ MicroProfileJwtContext.setCurrent(new VertxJsonWebToken(user))
├─ @Claim fields resolved from current JWT
└─ MicroProfileJwtContext.clear() at request end
requires com.guicedee.microprofile.jwt;.@Claim fields must opens their package to com.google.guice.@Claim works without @Inject (via SPI registration).MicroProfileJwtContext.clear() must be called at end of request to prevent memory leaks.io.vertx:vertx-auth-jwt) is required at runtime for token verification.JsonWebToken binding resolves from MicroProfileJwtContext; absent a scoped or fallback token it is null. The ThreadLocal fallback must also be cleared by its owner.@Claim("name") → value attribute; @Claim(standard = Claims.sub) → standard enum name.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub guicedee/ai-rules --plugin guicedee-jwt