add try-resource
@@ -160,7 +160,7 @@ public class OpenIdConnectAuthenticator implements SsoAuthenticator {
}
protected void parseJwtClaim(final String jwtClaim, final Map<String, Object> attributes) throws IOException {
- final JsonParser jsonParser = jsonFactory.createJsonParser(jwtClaim);
+ try (final JsonParser jsonParser = jsonFactory.createJsonParser(jwtClaim)) {
while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
final String name = jsonParser.getCurrentName();
if (name != null) {
@@ -199,6 +199,7 @@ public class OpenIdConnectAuthenticator implements SsoAuthenticator {
}
}
}
+ }
protected TokenResponse getTokenUrl(final String code) throws IOException {
return new AuthorizationCodeTokenRequest(httpTransport, jsonFactory, new GenericUrl(getOicTokenServerUrl()), code)//
