Hi,
I'm trying to connect to Genesys cloud using SDK version 137.0.0
Using the following code I can't authenticate when I'm on a enterprise network with proxy (with variable useProxy=true). However, when I'm using a direct connection without proxy (useProxy=false) it works fine:
*public static void initializePurecloudInstance() {*
* System.out.println("Initializing PureCloud instance...");*
* if (useProxy){*
* Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(PROXY_URL, PROXY_PORT)); *
* apiClient = ApiClient.Builder.standard().withBasePath(PURECLOUDURL).withAuthenticatedProxy(proxy,proxyUser,pass).build();*
* }*
* else{*
* apiClient = ApiClient.Builder.standard().withBasePath(PURECLOUDURL).build();*
* } *
* Configuration.setDefaultApiClient(apiClient);*
* try {*
* ApiResponse<AuthResponse> authResponse = apiClient.authorizeClientCredentials(CLIENT_ID, CLIENT_SECRET);*
* System.out.println("...Done. TOKEN EXPIRES ON "+authResponse.getBody().getExpires_in()+" SECONDS");*
* } catch (ApiException e) {*
* System.out.println("Error: "+e.getLocalizedMessage()+e.toString());*
* e.printStackTrace();*
* System.out.println(e.getRawBody());*
* } catch (IOException e) {*
* System.out.println("Error: "+e.getLocalizedMessage()+e.toString());*
* e.printStackTrace();*
* System.out.println(e.getMessage());*
* }*
* }*
This is the consule log. What means "no client id provided"? the contants CLIENT_ID CLIENT_SECRET are correctly informed.
Initializing PureCloud instance...
oct 22, 2021 11:51:41 A. M. org.apache.http.impl.auth.HttpAuthenticator generateAuthResponse
WARNING: NEGOTIATE authentication error: No valid credentials provided (Mechanism level: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt))
oct 22, 2021 11:51:41 A. M. org.apache.http.impl.auth.HttpAuthenticator generateAuthResponse
WARNING: NTLM authentication error: Credentials cannot be used for NTLM authentication: com.mypurecloud.sdk.v2.connector.apache.ApacheHttpCredentialsProvider$CredentialsWrapper
Error: errorcom.mypurecloud.sdk.v2.ApiException: error
com.mypurecloud.sdk.v2.ApiException: error
- at com.mypurecloud.sdk.v2.ApiClient.interpretConnectorResponse(ApiClient.java:705)*
- at com.mypurecloud.sdk.v2.ApiClient.getAPIResponse(ApiClient.java:757)*
- at com.mypurecloud.sdk.v2.ApiClient.authorizeClientCredentials(ApiClient.java:302)*
- at Main.initializePurecloudInstance(Main.java:86)*
- at Main.main(Main.java:66)*
{"error":"invalid_client","description":"no client id provided","error_description":"no client id provided"}
Please, could you assist?
Thanks!