You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.
I did like to integrate my java application with a remotely deployed anchore-engine. I have used the API Client specified here as a guide . I still encounter authentication errors as below :
Exception in thread "main" io.swagger.client.ApiException: Unauthorized at io.swagger.client.ApiClient.handleResponse(ApiClient.java:922) at io.swagger.client.ApiClient.execute(ApiClient.java:838) at io.swagger.client.api.VulnerabilitiesApi.getImageVulnerabilitiesByTypeWithHttpInfo(VulnerabilitiesApi.java:142) at io.swagger.client.api.VulnerabilitiesApi.getImageVulnerabilitiesByType(VulnerabilitiesApi.java:127) at io.cavasTest.CavasTest.main(CavasTest.java:28)
I tried authenticating via the code below - // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap<String, Authentication>(); authentications.put("basicAuth", new HttpBasicAuth()); HttpBasicAuth httpBasicAuth = new HttpBasicAuth(); httpBasicAuth.setUsername("xxxxx"); httpBasicAuth.setPassword("xxxxx");
The text was updated successfully, but these errors were encountered:
hi @SyCode7 , looks like you're setting the username and password in a different HttpBasicAuth object than the one you added to the authentications map. I think you need:
authentications = new HashMap<String, Authentication>();
HttpBasicAuth httpBasicAuth = new HttpBasicAuth();
httpBasicAuth.setUsername("xxxxx");
httpBasicAuth.setPassword("xxxxx");
authentications.put("basicAuth", httpBasicAuth);
I did like to integrate my java application with a remotely deployed anchore-engine. I have used the API Client specified here as a guide . I still encounter authentication errors as below :
Exception in thread "main" io.swagger.client.ApiException: Unauthorized at io.swagger.client.ApiClient.handleResponse(ApiClient.java:922) at io.swagger.client.ApiClient.execute(ApiClient.java:838) at io.swagger.client.api.VulnerabilitiesApi.getImageVulnerabilitiesByTypeWithHttpInfo(VulnerabilitiesApi.java:142) at io.swagger.client.api.VulnerabilitiesApi.getImageVulnerabilitiesByType(VulnerabilitiesApi.java:127) at io.cavasTest.CavasTest.main(CavasTest.java:28)
I tried authenticating via the code below -
// Setup authentications (key: authentication name, value: authentication). authentications = new HashMap<String, Authentication>(); authentications.put("basicAuth", new HttpBasicAuth()); HttpBasicAuth httpBasicAuth = new HttpBasicAuth(); httpBasicAuth.setUsername("xxxxx"); httpBasicAuth.setPassword("xxxxx");
The text was updated successfully, but these errors were encountered: