on ‎2024 Jun 06 12:36 AM
Hello,
I am working on a java client project to call an odata V4 service from an on-premise S4.
My java client worked fine for a public odata url which doesn't require Basic authorization username, password.
For the on-premise S4, I can test it successfully in Postman where Basic auth username/password are specified in Authorization tab.
But I still can't find any corresponding sample java source code for oData Basic authorization.
Any help is appreciated.
Regards,
hn
PS. I have tried these codes without success:
client.getConfiguration().setHttpClientFactory(new DefaultHttpClientFactory() {
@SuppressWarnings("deprecation")
@Override
public DefaultHttpClient create(HttpMethod method, URI uri) {
final DefaultHttpClient client = super.create(method, uri);
client.addRequestInterceptor(new HttpRequestInterceptor(){
@Override
public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
request.addHeader("Authorization", "Basic " + auth);
}
}
);
return client;
}
}
);
Request clarification before answering.
Update: it works for http Basic authorization only.
My issue is actually about Https certification.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.