I try to consume a CF destination defined as Oauth2ClientCredentials, where the authentication server needs only user/password and not clientid/clientsecret to generate the token. I have a dummy clientid and client secret in the destination configuration as it is mandatory, but it seems that it takes in consideration only the client id/secret and not the token user/password. The stack trace is:
com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException: Failed to get authentication headers. Destination service returned error: unauthorized_client.
at com.sap.cloud.sdk.cloudplatform.connectivity.ScpCfHttpDestinationPropertyFactory.getAuthTokenHeaders(ScpCfHttpDestinationPropertyFactory.java:376) ~[cloudplatform-connectivity-scp-cf-3.0.0.jar:na]
at com.sap.cloud.sdk.cloudplatform.connectivity.ScpCfHttpDestinationPropertyFactory.getHeadersFromDestination(ScpCfHttpDestinationPropertyFactory.java:328) ~[cloudplatform-connectivity-scp-cf-3.0.0.jar:na]
at com.sap.cloud.sdk.cloudplatform.connectivity.ScpCfHttpDestination.getHeaders(ScpCfHttpDestination.java:288) ~[cloudplatform-connectivity-scp-cf-3.0.0.jar:na]
at com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientWrapper.wrapRequest(HttpClientWrapper.java:86) ~[cloudplatform-connectivity-3.0.0.jar:na]
at com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientWrapper.execute(HttpClientWrapper.java:97) ~[cloudplatform-connectivity-3.0.0.jar:na]
at com.demo.destinationtest.MainController.worksoft(MainController.java:111) ~[classes/:na]
The ScpCfHttpDestination value in debugger is:
ScpCfHttpDestination(destinationType=HTTP, name=test, description=test connection, propertiesByName=ScpCfDestination(destinationType=HTTP, name=test, description=test connection, propertiesByName=DefaultDestination(properties={tokenServiceURLType=Dedicated, clientId=dummy, Description=test connection, tokenServiceUser=mymail@domain.com, tokenServiceURL=http://domain/executionmanager/api/Token, URL=http://domain/executionmanager/api/Requests, Name=test, tokenServicePassword=(hidden), authTokens=[ScpCfDestinationServiceV1Response.DestinationAuthToken(type=, value=, error=unauthorized_client, expiresIn=0)], Type=HTTP, certificates=null, Authentication=OAuth2ClientCredentials, clientSecret=STOTest3, ProxyType=Internet})))
Another destination where I have a good client secret/client id works fine.