@Override
    public String getSecret() {
        if (store != null) {
            var cache = store.get(getClientId());
            if (cache.isPresent()) {
                return cache.get();
            }
        }
        // https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens#3262048
        var claimsSet = new JWTClaimsSet.Builder()
            .issuer(getTeamID())
            .audience("https://appleid.apple.com")
            .subject(getClientId())
            .issueTime(Date.from(Instant.now()))
            .expirationTime(Date.from(Instant.now().plusSeconds(timeout.toSeconds())))
            .build();
        var signedJWT = new SignedJWT(
            new JWSHeader.Builder(JWSAlgorithm.ES256).keyID(privateKeyID).build(),
            claimsSet);
        JWSSigner signer;
        try {
            signer = new ECDSASigner(privateKey);
            signedJWT.sign(signer);
        } catch (JOSEException e) {
            throw new OidcException(e);
        }
        var secret = signedJWT.serialize();
        if (store != null) {
            store.set(getClientId(), secret);
        }
        return secret;
    }
{@inheritDoc}

Generate client secret (JWT) and cache it until expiration timeout
pac4j-oidc/src/main/java/org/pac4j/oidc/config/AppleOidcConfiguration.java