use of com.opentext.ia.sdk.support.http.rest.GatewayInfo in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class Authenticate method main.
@SuppressWarnings("PMD.SystemPrintln")
public static void main(String[] args) {
HttpClient httpClient = new ApacheHttpClient();
try {
// Log in to the gateway with user name & password
AuthenticationStrategy authentication = new JwtAuthentication(USER_NAME, PASSWORD, new GatewayInfo(GATEWAY_URL, CLIENT_ID, CLIENT_SECRET), httpClient);
// Get an authentication header using a token provided by the gateway
Header header = authentication.issueAuthHeader();
// Use this header in calls using the HTTP client
System.out.println(header);
} finally {
httpClient.close();
}
}
Aggregations