use of org.jose4j.jwt.JwtClaims in project light-4j by networknt.
the class JwtIssuerTest method longLivedProductAccessJwt.
@Test
public void longLivedProductAccessJwt() throws Exception {
JwtClaims claims = ClaimsUtil.getTestClaims("steve", "EMPLOYEE", "f7d42348-c647-4efb-a52d-4c5787421e72", Arrays.asList("party.product.read", "server.info.r"));
claims.setExpirationTimeMinutesInTheFuture(5256000);
String jwt = JwtIssuer.getJwt(claims);
System.out.println("***LongLived product access JWT***: " + jwt);
}
use of org.jose4j.jwt.JwtClaims in project light-4j by networknt.
the class JwtIssuerTest method longLivedCodegenJwt.
@Test
public void longLivedCodegenJwt() throws Exception {
JwtClaims claims = ClaimsUtil.getTestClaims("steve", "EMPLOYEE", "f7d42348-c647-4efb-a52d-4c5787421e72", Arrays.asList("codegen.r", "codegen.w", "server.info.r"));
claims.setExpirationTimeMinutesInTheFuture(5256000);
String jwt = JwtIssuer.getJwt(claims);
System.out.println("***LongLived Codegen JWT***: " + jwt);
}
use of org.jose4j.jwt.JwtClaims in project light-4j by networknt.
the class JwtIssuerTest method longLivedReferenceJwt.
@Test
public void longLivedReferenceJwt() throws Exception {
Map<String, String> custom = new HashMap<>();
custom.put("consumer_application_id", "361");
custom.put("request_transit", "67");
JwtClaims claims = ClaimsUtil.getCustomClaims("steve", "EMPLOYEE", "f7d42348-c647-4efb-a52d-4c5787421e72", Arrays.asList("party.util.reference.read", "server.info.r"), custom);
claims.setExpirationTimeMinutesInTheFuture(5256000);
String jwt = JwtIssuer.getJwt(claims);
System.out.println("***LongLived reference JWT***: " + jwt);
}
use of org.jose4j.jwt.JwtClaims in project light-4j by networknt.
the class JwtIssuerTest method longlivedTokenizationJwt73.
@Test
public void longlivedTokenizationJwt73() throws Exception {
JwtClaims claims = ClaimsUtil.getTestClaims("steve", "EMPLOYEE", "f7d42348-c647-4efb-a52d-4c5787421e73", Arrays.asList("token.r", "token.w"));
claims.setExpirationTimeMinutesInTheFuture(5256000);
String jwt = JwtIssuer.getJwt(claims);
System.out.println("***Long lived token for tokenizaiton***: " + jwt);
}
use of org.jose4j.jwt.JwtClaims in project light-4j by networknt.
the class ClaimsUtil method getTestClaims.
public static JwtClaims getTestClaims(String userId, String userType, String clientId, List<String> scope) {
JwtClaims claims = JwtIssuer.getDefaultJwtClaims();
claims.setClaim("user_id", userId);
claims.setClaim("user_type", userType);
claims.setClaim("client_id", clientId);
// multi-valued claims work too and will end up as a JSON array
if (scope != null)
claims.setStringListClaim("scope", scope);
return claims;
}
Aggregations