I'm trying to use the goolge-oauth2 library, and when i call the refresh token method on the class I have this error:
Caused by:
java.lang.NoClassDefFoundError: javax/net/ssl/HttpsURLConnection
at com.google.api.client.http.javanet.NetHttpTransport.buildRequest(NetHttpTransport.java:152)
at com.google.api.client.http.javanet.NetHttpTransport.buildRequest(NetHttpTransport.java:55)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:889)
at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:441)
at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:157)
at com.google.auth.oauth2.OAuth2Credentials.refreshIfExpired(OAuth2Credentials.java:174)
This is the code I use to retrieve the ServiceAccountCredentials object
ServiceAccountCredentials googleCredential = ServiceAccountCredentials.fromPkcs8(client_id, client_email, private_key,private_key_id, Arrays.asList(scope));
googleCredential.refreshIfExpired();
using "https://www.googleapis.com/auth/iam" as scope
now this is the first time i need to connect to an Https url so maybe i'm missing something...