2020-06-18 10:56:20 +02:00
|
|
|
package org.gcube.oidc.rest;
|
|
|
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
|
|
|
public class RestHelperTest {
|
|
|
|
|
|
|
|
public RestHelperTest() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
|
URL tokenURL = new URL("https://nubis2.int.d4science.net/auth/realms/d4science/protocol/openid-connect/token");
|
2020-07-03 17:31:19 +02:00
|
|
|
JWTToken token = OpenIdConnectRESTHelper.queryClientToken("lr62_portal", "28726d01-9f24-4ef4-a057-3d208d96aaa0",
|
|
|
|
tokenURL);
|
|
|
|
|
|
|
|
// System.out.println(token.getExpAsDate());
|
|
|
|
System.out.println(token.getAzp());
|
|
|
|
// Thread.sleep((token.getExp() * 1000 - System.currentTimeMillis() + 5000));
|
|
|
|
// System.out.println(token.isExpired());
|
2020-06-18 10:56:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|