Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class JwtClaimsSet

  1. Object
  2. JwtClaimsSet

The claims of a token that is about to be signed.

long now = System.currentTimeMillis() / 1000;
JwtClaimsSet claims = JwtClaimsSet.builder()
        .issuer("https://orders.example.com")
        .subject(user.getId())
        .audience("orders-api")
        .issuedAt(now)
        .expiresAt(now + 300)
        .claim("scope", "orders:read")
        .build();

Nested types

class JwtClaimsSet.BuilderBuilds a JwtClaimsSet.

Methods

public static JwtClaimsSet.Builder builder()
public static JwtClaimsSet.Builder from(JwtClaimsSet claims)A builder that starts from these claims.
public Map<String, Object> getClaims()
public Object getClaim(String name)

Inherited methods

Method details

builder

public static JwtClaimsSet.Builder builder()

from

public static JwtClaimsSet.Builder from(JwtClaimsSet claims)
A builder that starts from these claims.

getClaims

public Map<String, Object> getClaims()

getClaim

public Object getClaim(String name)