use of org.jose4j.jwt.JwtClaims in project light-4j by networknt.
the class JwtIssuerTest method longLivedATMP1000Jwt.
@Test
public void longLivedATMP1000Jwt() throws Exception {
JwtClaims claims = ClaimsUtil.getTestClaims("eric", "EMPLOYEE", "f7d42348-c647-4efb-a52d-4c5787421e72", Arrays.asList("ATMP1000.w", "ATMP1000.r"), "user");
claims.setExpirationTimeMinutesInTheFuture(5256000);
String jwt = JwtIssuer.getJwt(claims);
System.out.println("***LongLived ATMP1000 JWT***: " + jwt);
}
use of org.jose4j.jwt.JwtClaims in project light-4j by networknt.
the class JwtIssuerTest method AcRoleAccessControlWrong.
/**
* The returned token contains scopes for access-control example
* @throws Exception
*/
@Test
public void AcRoleAccessControlWrong() throws Exception {
JwtClaims claims = ClaimsUtil.getTestClaims("stevehu", "CUSTOMER", "f7d42348-c647-4efb-a52d-4c5787421e72", Arrays.asList("account.r", "account.w"), "user");
claims.setExpirationTimeMinutesInTheFuture(5256000);
String jwt = JwtIssuer.getJwt(claims);
System.out.println("***Long lived token Authorization code customer with roles***: " + jwt);
}
use of org.jose4j.jwt.JwtClaims in project light-4j by networknt.
the class JwtIssuerTest method petstoreBootstrap.
/**
* This token is used to connect to the light-config-server with serviceId 0100 for testing with a service specific for a client.
* @throws Exception
*/
@Test
public void petstoreBootstrap() throws Exception {
JwtClaims claims = ClaimsUtil.getTestCcClaimsScopeService("f7d42348-c647-4efb-a52d-4c5787421e72", "portal.r portal.w", "com.networknt.petstore-3.0.1");
claims.setExpirationTimeMinutesInTheFuture(5256000);
String jwt = JwtIssuer.getJwt(claims);
System.out.println("***Reference Long lived Bootstrap token for config server and controller: " + jwt);
}
use of org.jose4j.jwt.JwtClaims in project light-4j by networknt.
the class JwtIssuerTest method AcGroupAccessControlWrong.
/**
* The returned token contains scopes for access-control example
* @throws Exception
*/
@Test
public void AcGroupAccessControlWrong() throws Exception {
JwtClaims claims = ClaimsUtil.getTestClaimsGroup("stevehu", "EMPLOYEE", "f7d42348-c647-4efb-a52d-4c5787421e72", Arrays.asList("account.r", "account.w"), "backOffice");
claims.setExpirationTimeMinutesInTheFuture(5256000);
String jwt = JwtIssuer.getJwt(claims);
System.out.println("***Long lived token Authorization code customer with roles***: " + jwt);
}
use of org.jose4j.jwt.JwtClaims in project light-4j by networknt.
the class JwtIssuerTest method longlivedLightPortalController.
@Test
public void longlivedLightPortalController() throws Exception {
JwtClaims claims = ClaimsUtil.getTestClaims("stevehu@gmail.com", "EMPLOYEE", "f7d42348-c647-4efb-a52d-4c5787421e73", Arrays.asList("portal.r", "portal.w"), "user CtlPltAdmin CtlPltRead CtlPltWrite");
claims.setExpirationTimeMinutesInTheFuture(5256000);
String jwt = JwtIssuer.getJwt(claims);
System.out.println("***Long lived token for portal controller ***: " + jwt);
}
Aggregations