use of org.forgerock.json.jose.jws.JwsHeader in project OpenAM by OpenRock.
the class PolicyRequestTest method getJwtSubject.
private Jwt getJwtSubject(final String subjectName) {
JwsHeader header = new JwsHeader(Collections.<String, Object>emptyMap());
JwtClaimsSet claims = new JwtClaimsSet();
claims.setSubject(subjectName);
SigningHandler handler = new NOPSigningHandler();
return new SignedJwt(header, claims, handler);
}
use of org.forgerock.json.jose.jws.JwsHeader in project OpenAM by OpenRock.
the class OAuth2JwtTest method expirationTimeSetInPastJWTShouldBeInvalid.
@Test
public void expirationTimeSetInPastJWTShouldBeInvalid() {
JwsHeader header = new JwsHeader(Collections.<String, Object>emptyMap());
JwtClaimsSet claims = getJwtClaimsSet(VALID_NOT_BEFORE_TIME, INVALID_EXPIRATION_TIME);
SigningHandler handler = new NOPSigningHandler();
OAuth2Jwt oAuth2Jwt = getOAuth2Jwt(header, claims, handler);
assertTrue(!oAuth2Jwt.isValid(handler));
}
Aggregations