Skip to content

Commit

Permalink
fixes networknt#823 add a new test case for JwtIssuerTest to generate…
Browse files Browse the repository at this point in the history
… light-proxy token (networknt#824)
  • Loading branch information
stevehu authored Nov 19, 2020
1 parent f7806ae commit 7c35427
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,16 @@ public void longlivedCcLocalPortalScope() throws Exception {
}

/**
* The returned token contains scp as the key for the scope. All scopes are separated by space.
* The returned token contains scp as the key for the scope. Some OAuth 2.0 provider like Okta use this claim. All scopes are separated by comma.
* The token will have proxy.r and proxy.w as scopes for testing with proxy configuration in light-config-test proxy folder.
* @throws Exception
*/
@Test
public void longlivedCcLocalPortalScopeScp() throws Exception {
JwtClaims claims = ClaimsUtil.getTestCcClaimsScopeScp("f7d42348-c647-4efb-a52d-4c5787421e73", "portal.r portal.w");
public void longlivedCcLocalProxyWithScp() throws Exception {
JwtClaims claims = ClaimsUtil.getTestCcClaimsWithScp("f7d42348-c647-4efb-a52d-4c5787421e73", Arrays.asList("proxy.r", "proxy.w"));
claims.setExpirationTimeMinutesInTheFuture(5256000);
String jwt = JwtIssuer.getJwt(claims);
System.out.println("***Long lived token for portal lightapi***: " + jwt);
System.out.println("***Long lived token for proxy***: " + jwt);
}

}

0 comments on commit 7c35427

Please sign in to comment.