ZFS API - Swagger code-gen Java : 403 X-Cache: Error from cloudfront

Hello,

I just created my first ZFS API sample using java 8 with sources generated using swagger-codegen.

Following GET work with Postman :

{
{protocol}}{
{gateway-host}}{
{gateway-url}}reference/countries

With my java code i received this error :

INFOS: 1 * Client response received on thread main 1 < 403 1 < Connection: keep-alive 1 < Content-Length: 278 1 < Content-Type: application/json 1 < Date: Mon, 17 Jun 2019 11:49:06 GMT 1 < Via: 1.1 1437ff2cfbc1ea8c7a36e6b0ce6e935a.cloudfront.net (CloudFront) 1 < x-amz-apigw-id: bbCn0EYdDoEFWNg= 1 < X-Amz-Cf-Id: 1CH5M5jMA4gFDoN2ppJCYqKYTRQVel06t1fB5hSPQVB1Hiq-4dNxYg== 1 < x-amzn-ErrorType: IncompleteSignatureException 1 < x-amzn-RequestId: e8eddab7-90f5-11e9-a6a3-09a03b94e39f 1 < X-Cache: Error from cloudfront {"message":"'host' not a valid key=value pair (missing equal-sign) in Authorization header: 'Signature keyId=\"XXXXX\",algorithm=\"hmac-sha256\",headers=\"(request-target) host date\",signature=\"XXXX\"'."}

When i compare value of Authorization between Postman and Java it's the same.

Do i miss something else ?

Best Answer

  • thank you again

    @Prabhjyot.Mandla

    This issue is solved man issue was under my data parameter :

    DateFormat df = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z");

    Because My local is french by default under JVM i have to add :

    DateFormat df = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);

Answers

  • @thomas.gauroy,

    Thank you for your query.

    Can you please provide us the full request headers and the response headers of the API call to look into it?

  • Selenium online training is a collection of open source APIs which are used to automate the testing of a web application. Selenium training is platform-independent since the same code can be used on different Operating Systems like this Microsoft Windows, Apple OS, and Linux.

  • hi @Prabhjyot.Mandla

    thank for your answer here the header content . :

    Signature keyId="XXXXX",algorithm="hmac-sha256",headers="(request-target) host date",signature="n/Zj+fh8VH7wuUig7jW2xhyP56WnsSEpkMkG8Iqh2mg="

  • @thomas.gauroy

    We would need the full request and response headers in order to investigate on the cause of the error.

  • /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=56678:/Applications/IntelliJ IDEA CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA CE.app/Contents/plugins/junit/lib/junit-rt.jar:/Applications/IntelliJ IDEA CE.app/Contents/plugins/junit/lib/junit5-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/tools.jar:/Users/thomasgauroy/Dev/KomgoProject/worldcheckproto/target/test-classes:/Users/thomasgauroy/Dev/KomgoProject/worldcheckproto/target/classes:/Users/thomasgauroy/.m2/repository/org/springframework/boot/spring-boot-starter-batch/2.1.4.RELEASE/spring-boot-starter-batch-2.1.4.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/springframework/boot/spring-boot-starter/2.1.4.RELEASE/spring-boot-starter-2.1.4.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/springframework/boot/spring-boot/2.1.4.RELEASE/spring-boot-2.1.4.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.1.4.RELEASE/spring-boot-autoconfigure-2.1.4.RELEASE.jar:/Users/thomasgauroy/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:/Users/thomasgauroy/.m2/repository/org/springframework/spring-core/5.1.6.RELEASE/spring-core-5.1.6.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/springframework/spring-jcl/5.1.6.RELEASE/spring-jcl-5.1.6.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar:/Users/thomasgauroy/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/2.1.4.RELEASE/spring-boot-starter-jdbc-2.1.4.RELEASE.jar:/Users/thomasgauroy/.m2/repository/com/zaxxer/HikariCP/3.2.0/HikariCP-3.2.0.jar:/Users/thomasgauroy/.m2/repository/org/springframework/spring-jdbc/5.1.6.RELEASE/spring-jdbc-5.1.6.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/springframework/batch/spring-batch-core/4.1.2.RELEASE/spring-batch-core-4.1.2.RELEASE.jar:/Users/thomasgauroy/.m2/repository/javax/batch/javax.batch-api/1.0/javax.batch-api-1.0.jar:/Users/thomasgauroy/.m2/repository/org/codehaus/jettison/jettison/1.2/jettison-1.2.jar:/Users/thomasgauroy/.m2/repository/org/springframework/batch/spring-batch-infrastructure/4.1.2.RELEASE/spring-batch-infrastructure-4.1.2.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/springframework/retry/spring-retry/1.2.4.RELEASE/spring-retry-1.2.4.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/springframework/spring-aop/5.1.6.RELEASE/spring-aop-5.1.6.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/springframework/spring-beans/5.1.6.RELEASE/spring-beans-5.1.6.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/springframework/spring-context/5.1.6.RELEASE/spring-context-5.1.6.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/springframework/spring-expression/5.1.6.RELEASE/spring-expression-5.1.6.RELEASE.jar:/Users/thomasgauroy/.m2/repository/org/springframework/spring-tx/5.1.6.RELEASE/spring-tx-5.1.6.RELEASE.jar:/Users/thomasgauroy/.m2/repository/com/komgo/platform/samples/api/api-sample/1.0-SNAPSHOT/api-sample-1.0-SNAPSHOT.jar:/Users/thomasgauroy/.m2/repository/io/rest-assured/rest-assured/3.3.0/rest-assured-3.3.0.jar:/Users/thomasgauroy/.m2/repository/org/codehaus/groovy/groovy/2.4.15/groovy-2.4.15.jar:/Users/thomasgauroy/.m2/repository/org/codehaus/groovy/groovy-xml/2.4.15/groovy-xml-2.4.15.jar:/Users/thomasgauroy/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar:/Users/thomasgauroy/.m2/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar:/Users/thomasgauroy/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar:/Users/thomasgauroy/.m2/repository/org/apache/httpcomponents/httpmime/4.5.3/httpmime-4.5.3.jar:/Users/thomasgauroy/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/Users/thomasgauroy/.m2/repository/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar:/Users/thomasgauroy/.m2/repository/org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar:/Users/thomasgauroy/.m2/repository/io/rest-assured/json-path/3.3.0/json-path-3.3.0.jar:/Users/thomasgauroy/.m2/repository/org/codehaus/groovy/groovy-json/2.4.15/groovy-json-2.4.15.jar:/Users/thomasgauroy/.m2/repository/io/rest-assured/rest-assured-common/3.3.0/rest-assured-common-3.3.0.jar:/Users/thomasgauroy/.m2/repository/io/rest-assured/xml-path/3.3.0/xml-path-3.3.0.jar:/Users/thomasgauroy/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar:/Users/thomasgauroy/.m2/repository/javax/xml/bind/jaxb-api/2.2.12/jaxb-api-2.2.12.jar:/Users/thomasgauroy/.m2/repository/com/sun/xml/bind/jaxb-osgi/2.2.10/jaxb-osgi-2.2.10.jar:/Users/thomasgauroy/.m2/repository/org/apache/sling/org.apache.sling.javax.activation/0.1.0/org.apache.sling.javax.activation-0.1.0.jar:/Users/thomasgauroy/.m2/repository/javax/activation/activation/1.1.1/activation-1.1.1.jar:/Users/thomasgauroy/.m2/repository/javax/ws/rs/javax.ws.rs-api/2.1.1/javax.ws.rs-api-2.1.1.jar:/Users/thomasgauroy/.m2/repository/javax/json/javax.json-api/1.1.4/javax.json-api-1.1.4.jar:/Users/thomasgauroy/.m2/repository/org/mongodb/mongo-java-driver/3.9.1/mongo-java-driver-3.9.1.jar:/Users/thomasgauroy/.m2/repository/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar:/Users/thomasgauroy/.m2/repository/org/threeten/threetenbp/1.3.8/threetenbp-1.3.8.jar:/Users/thomasgauroy/.m2/repository/com/squareup/okhttp3/okhttp/3.14.1/okhttp-3.14.1.jar:/Users/thomasgauroy/.m2/repository/com/squareup/okio/okio/1.17.2/okio-1.17.2.jar:/Users/thomasgauroy/.m2/repository/io/gsonfire/gson-fire/1.0.1/gson-fire-1.0.1.jar:/Users/thomasgauroy/.m2/repository/io/swagger/codegen/v3/swagger-codegen-maven-plugin/3.0.8/swagger-codegen-maven-plugin-3.0.8.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/maven-core/3.2.5/maven-core-3.2.5.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/maven-model/3.2.5/maven-model-3.2.5.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/maven-settings/3.2.5/maven-settings-3.2.5.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/maven-settings-builder/3.2.5/maven-settings-builder-3.2.5.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/maven-repository-metadata/3.2.5/maven-repository-metadata-3.2.5.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/maven-artifact/3.2.5/maven-artifact-3.2.5.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/maven-model-builder/3.2.5/maven-model-builder-3.2.5.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/maven-aether-provider/3.2.5/maven-aether-provider-3.2.5.jar:/Users/thomasgauroy/.m2/repository/org/eclipse/aether/aether-spi/1.0.0.v20140518/aether-spi-1.0.0.v20140518.jar:/Users/thomasgauroy/.m2/repository/org/eclipse/aether/aether-impl/1.0.0.v20140518/aether-impl-1.0.0.v20140518.jar:/Users/thomasgauroy/.m2/repository/org/eclipse/aether/aether-api/1.0.0.v20140518/aether-api-1.0.0.v20140518.jar:/Users/thomasgauroy/.m2/repository/org/eclipse/aether/aether-util/1.0.0.v20140518/aether-util-1.0.0.v20140518.jar:/Users/thomasgauroy/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.0.M1/org.eclipse.sisu.plexus-0.3.0.M1.jar:/Users/thomasgauroy/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar:/Users/thomasgauroy/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar:/Users/thomasgauroy/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.0.M1/org.eclipse.sisu.inject-0.3.0.M1.jar:/Users/thomasgauroy/.m2/repository/org/sonatype/sisu/sisu-guice/3.2.3/sisu-guice-3.2.3-no_aop.jar:/Users/thomasgauroy/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/Users/thomasgauroy/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/thomasgauroy/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar:/Users/thomasgauroy/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar:/Users/thomasgauroy/.m2/repository/org/codehaus/plexus/plexus-classworlds/2.5.2/plexus-classworlds-2.5.2.jar:/Users/thomasgauroy/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar:/Users/thomasgauroy/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar:/Users/thomasgauroy/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/maven-compat/3.2.5/maven-compat-3.2.5.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/wagon/wagon-provider-api/2.8/wagon-provider-api-2.8.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/maven-plugin-api/3.2.5/maven-plugin-api-3.2.5.jar:/Users/thomasgauroy/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.4/maven-plugin-annotations-3.4.jar:/Users/thomasgauroy/.m2/repository/io/swagger/codegen/v3/swagger-codegen/3.0.8/swagger-codegen-3.0.8.jar:/Users/thomasgauroy/.m2/repository/io/swagger/swagger-parser/1.0.44/swagger-parser-1.0.44.jar:/Users/thomasgauroy/.m2/repository/io/swagger/swagger-core/1.5.22/swagger-core-1.5.22.jar:/Users/thomasgauroy/.m2/repository/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.9.8/jackson-dataformat-yaml-2.9.8.jar:/Users/thomasgauroy/.m2/repository/io/swagger/swagger-models/1.5.22/swagger-models-1.5.22.jar:/Users/thomasgauroy/.m2/repository/io/swagger/swagger-annotations/1.5.22/swagger-annotations-1.5.22.jar:/Users/thomasgauroy/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar:/Users/thomasgauroy/.m2/repository/io/swagger/parser/v3/swagger-parser/2.0.12/swagger-parser-2.0.12.jar:/Users/thomasgauroy/.m2/repository/io/swagger/parser/v3/swagger-parser-v2-converter/2.0.12/swagger-parser-v2-converter-2.0.12.jar:/Users/thomasgauroy/.m2/repository/io/swagger/core/v3/swagger-models/2.0.8/swagger-models-2.0.8.jar:/Users/thomasgauroy/.m2/repository/io/swagger/parser/v3/swagger-parser-core/2.0.12/swagger-parser-core-2.0.12.jar:/Users/thomasgauroy/.m2/repository/io/swagger/parser/v3/swagger-parser-v3/2.0.12/swagger-parser-v3-2.0.12.jar:/Users/thomasgauroy/.m2/repository/io/swagger/core/v3/swagger-core/2.0.8/swagger-core-2.0.8.jar:/Users/thomasgauroy/.m2/repository/io/swagger/core/v3/swagger-annotations/2.0.8/swagger-annotations-2.0.8.jar:/Users/thomasgauroy/.m2/repository/io/swagger/swagger-codegen/2.4.5/swagger-codegen-2.4.5.jar:/Users/thomasgauroy/.m2/repository/io/swagger/swagger-compat-spec-parser/1.0.44/swagger-compat-spec-parser-1.0.44.jar:/Users/thomasgauroy/.m2/repository/com/github/java-json-tools/json-schema-validator/2.2.8/json-schema-validator-2.2.8.jar:/Users/thomasgauroy/.m2/repository/com/github/java-json-tools/json-schema-core/1.2.8/json-schema-core-1.2.8.jar:/Users/thomasgauroy/.m2/repository/com/github/fge/uri-template/0.9/uri-template-0.9.jar:/Users/thomasgauroy/.m2/repository/javax/mail/mailapi/1.4.3/mailapi-1.4.3.jar:/Users/thomasgauroy/.m2/repository/joda-time/joda-time/2.9.7/joda-time-2.9.7.jar:/Users/thomasgauroy/.m2/repository/com/googlecode/libphonenumber/libphonenumber/8.0.0/libphonenumber-8.0.0.jar:/Users/thomasgauroy/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.3/jopt-simple-5.0.3.jar:/Users/thomasgauroy/.m2/repository/com/github/fge/json-patch/1.6/json-patch-1.6.jar:/Users/thomasgauroy/.m2/repository/com/github/fge/jackson-coreutils/1.6/jackson-coreutils-1.6.jar:/Users/thomasgauroy/.m2/repository/com/github/fge/msg-simple/1.1/msg-simple-1.1.jar:/Users/thomasgauroy/.m2/repository/com/github/fge/btf/1.2/btf-1.2.jar:/Users/thomasgauroy/.m2/repository/com/samskivert/jmustache/1.12/jmustache-1.12.jar:/Users/thomasgauroy/.m2/repository/org/slf4j/slf4j-ext/1.7.25/slf4j-ext-1.7.25.jar:/Users/thomasgauroy/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/Users/thomasgauroy/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/Users/thomasgauroy/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar:/Users/thomasgauroy/.m2/repository/com/google/guava/guava/23.0/guava-23.0.jar:/Users/thomasgauroy/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/Users/thomasgauroy/.m2/repository/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar:/Users/thomasgauroy/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:/Users/thomasgauroy/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:/Users/thomasgauroy/.m2/repository/com/github/jknack/handlebars/4.0.6/handlebars-4.0.6.jar:/Users/thomasgauroy/.m2/repository/org/antlr/antlr4-runtime/4.5.1-1/antlr4-runtime-4.5.1-1.jar:/Users/thomasgauroy/.m2/repository/org/mozilla/rhino/1.7R4/rhino-1.7R4.jar:/Users/thomasgauroy/.m2/repository/com/atlassian/commonmark/commonmark/0.9.0/commonmark-0.9.0.jar:/Users/thomasgauroy/.m2/repository/io/swagger/codegen/v3/swagger-codegen-generators/1.0.8/swagger-codegen-generators-1.0.8.jar:/Users/thomasgauroy/.m2/repository/com/itextpdf/itextpdf/5.5.13/itextpdf-5.5.13.jar:/Users/thomasgauroy/.m2/repository/io/socket/socket.io-client/1.0.0/socket.io-client-1.0.0.jar:/Users/thomasgauroy/.m2/repository/io/socket/engine.io-client/1.0.0/engine.io-client-1.0.0.jar:/Users/thomasgauroy/.m2/repository/org/json/json/20090211/json-20090211.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/jersey/core/jersey-common/2.28/jersey-common-2.28.jar:/Users/thomasgauroy/.m2/repository/jakarta/ws/rs/jakarta.ws.rs-api/2.1.5/jakarta.ws.rs-api-2.1.5.jar:/Users/thomasgauroy/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.4/jakarta.annotation-api-1.3.4.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/hk2/external/jakarta.inject/2.5.0/jakarta.inject-2.5.0.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/hk2/osgi-resource-locator/1.0.1/osgi-resource-locator-1.0.1.jar:/Users/thomasgauroy/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.9/jackson-databind-2.9.9.jar:/Users/thomasgauroy/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar:/Users/thomasgauroy/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.9/jackson-core-2.9.9.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/jersey/core/jersey-client/2.28/jersey-client-2.28.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/jersey/media/jersey-media-json-jackson/2.28/jersey-media-json-jackson-2.28.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/jersey/ext/jersey-entity-filtering/2.28/jersey-entity-filtering-2.28.jar:/Users/thomasgauroy/.m2/repository/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.9.8/jackson-module-jaxb-annotations-2.9.8.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/jersey/media/jersey-media-multipart/2.28/jersey-media-multipart-2.28.jar:/Users/thomasgauroy/.m2/repository/org/jvnet/mimepull/mimepull/1.9.11/mimepull-1.9.11.jar:/Users/thomasgauroy/.m2/repository/com/github/joschi/jackson/jackson-datatype-threetenbp/2.6.4/jackson-datatype-threetenbp-2.6.4.jar:/Users/thomasgauroy/.m2/repository/com/brsanthu/migbase64/2.2/migbase64-2.2.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/jersey/inject/jersey-hk2/2.28/jersey-hk2-2.28.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/hk2/hk2-locator/2.5.0/hk2-locator-2.5.0.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/hk2/external/aopalliance-repackaged/2.5.0/aopalliance-repackaged-2.5.0.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/hk2/hk2-api/2.5.0/hk2-api-2.5.0.jar:/Users/thomasgauroy/.m2/repository/org/glassfish/hk2/hk2-utils/2.5.0/hk2-utils-2.5.0.jar:/Users/thomasgauroy/.m2/repository/org/javassist/javassist/3.22.0-CR2/javassist-3.22.0-CR2.jar:/Users/thomasgauroy/.m2/repository/org/apache/commons/commons-csv/1.4/commons-csv-1.4.jar:/Users/thomasgauroy/.m2/repository/junit/junit/4.0/junit-4.0.jar:/Users/thomasgauroy/.m2/repository/net/sourceforge/tess4j/tess4j/4.3.1/tess4j-4.3.1.jar:/Users/thomasgauroy/.m2/repository/net/java/dev/jna/jna/5.1.0/jna-5.1.0.jar:/Users/thomasgauroy/.m2/repository/com/github/jai-imageio/jai-imageio-core/1.4.0/jai-imageio-core-1.4.0.jar:/Users/thomasgauroy/.m2/repository/org/ghost4j/ghost4j/1.0.1/ghost4j-1.0.1.jar:/Users/thomasgauroy/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/Users/thomasgauroy/.m2/repository/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar:/Users/thomasgauroy/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar:/Users/thomasgauroy/.m2/repository/org/apache/xmlgraphics/xmlgraphics-commons/1.4/xmlgraphics-commons-1.4.jar:/Users/thomasgauroy/.m2/repository/com/lowagie/itext/2.1.7/itext-2.1.7.jar:/Users/thomasgauroy/.m2/repository/org/apache/pdfbox/pdfbox/2.0.12/pdfbox-2.0.12.jar:/Users/thomasgauroy/.m2/repository/org/apache/pdfbox/fontbox/2.0.12/fontbox-2.0.12.jar:/Users/thomasgauroy/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/thomasgauroy/.m2/repository/org/apache/pdfbox/pdfbox-tools/2.0.12/pdfbox-tools-2.0.12.jar:/Users/thomasgauroy/.m2/repository/org/apache/pdfbox/pdfbox-debugger/2.0.12/pdfbox-debugger-2.0.12.jar:/Users/thomasgauroy/.m2/repository/org/apache/pdfbox/jbig2-imageio/3.0.2/jbig2-imageio-3.0.2.jar:/Users/thomasgauroy/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar:/Users/thomasgauroy/.m2/repository/net/sourceforge/lept4j/lept4j/1.10.0/lept4j-1.10.0.jar:/Users/thomasgauroy/.m2/repository/org/jboss/jboss-vfs/3.2.14.Final/jboss-vfs-3.2.14.Final.jar:/Users/thomasgauroy/.m2/repository/org/jboss/logging/jboss-logging/3.1.4.GA/jboss-logging-3.1.4.GA.jar:/Users/thomasgauroy/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar:/Users/thomasgauroy/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/Users/thomasgauroy/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.25/jcl-over-slf4j-1.7.25.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 TestLibs,getCountriesFromWorldCheck
    Signature keyId="XXXXX",algorithm="hmac-sha256",headers="(request-target) host date",signature="RmK/jmXarBP6yl3J6+Dpllo4tOW23oHNcQTE8gK7Ytk="
    (request-target): get /v1/reference/countries
    host: zfs-world-check-one-api-pilot.thomsonreuters.com
    date: mer., 19 juin 2019 12:44:32 GMT
    RmK/jmXarBP6yl3J6+Dpllo4tOW23oHNcQTE8gK7Ytk=
    juin 19, 2019 2:44:33 PM org.glassfish.jersey.logging.LoggingInterceptor log
    INFOS: 1 * Sending client request on thread main
    1 > GET https://zfs-world-check-one-api-pilot.thomsonreuters.com/v1/reference/countries
    1 > Accept: application/json
    1 > Authorization: Signature keyId="XXXXX",algorithm="hmac-sha256",headers="(request-target) host date",signature="RmK/jmXarBP6yl3J6+Dpllo4tOW23oHNcQTE8gK7Ytk="
    1 > cache-control: no-cache
    1 > contentLength: 212
    1 > Date: mer., 19 juin 2019 12:44:32 GMT
    1 > Host: zfs-world-check-one-api-pilot.thomsonreuters.com
    1 > provider-type: WATCHLIST
    1 > User-Agent: Swagger-Codegen/1.0.0/java

    juin 19, 2019 2:44:33 PM org.glassfish.jersey.client.internal.HttpUrlConnector setOutboundHeaders
    AVERTISSEMENT: Attempt to send restricted header(s) while the [sun.net.http.allowRestrictedHeaders] system property not set. Header(s) will possibly be ignored.
    juin 19, 2019 2:44:34 PM org.glassfish.jersey.logging.LoggingInterceptor log
    INFOS: 1 * Client response received on thread main
    1 < 403
    1 < Connection: keep-alive
    1 < Content-Length: 278
    1 < Content-Type: application/json
    1 < Date: Wed, 19 Jun 2019 12:44:34 GMT
    1 < Via: 1.1 9946ab784d1328de1a34d3840ab6cea6.cloudfront.net (CloudFront)
    1 < x-amz-apigw-id: bhwn5EJjjoEFhYQ=
    1 < X-Amz-Cf-Id: 2ubEPv3h40PbMDuvPJtMJOSfoNUJKK0l0Gv6cxWzL8j1SdbtSbZqhA==
    1 < X-Amz-Cf-Pop: CDG3-C1
    1 < x-amzn-ErrorType: IncompleteSignatureException
    1 < x-amzn-RequestId: fdb1891b-928f-11e9-bd35-4da1f726be6c
    1 < X-Cache: Error from cloudfront
    {"message":"'host' not a valid key=value pair (missing equal-sign) in Authorization header: 'Signature keyId=\"XXXXX\",algorithm=\"hmac-sha256\",headers=\"(request-target) host date\",signature=\"RmK/jmXarBP6yl3J6+Dpllo4tOW23oHNcQTE8gK7Ytk=\"'."}



    com.komgo.io.swagger.api.proto.ApiException: {"message":"'host' not a valid key=value pair (missing equal-sign) in Authorization header: 'Signature keyId=\"XXXXX\",algorithm=\"hmac-sha256\",headers=\"(request-target) host date\",signature=\"RmK/jmXarBP6yl3J6+Dpllo4tOW23oHNcQTE8gK7Ytk=\"'."}


    at com.komgo.io.swagger.api.proto.ApiClient.invokeAPI(ApiClient.java:737)
    at com.komgo.io.swagger.api.proto.worldcheck.ReferenceApi.referenceCountriesGet(ReferenceApi.java:73)
    at TestLibs.getCountriesFromWorldCheck(TestLibs.java:101)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
    at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
    at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
    at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
    at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
    at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
    at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
    at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
    at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
    at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:121)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)


    Process finished with exit code 255
  • @Prabhjyot.Mandla

    here the full stack of error

  • @thomas.gauroy,

    Thank you for the details.

    Can you please let us know if you are getting Error 403 only this specific request or all the requests?

  • @Prabhjyot.Mandla same result with all requests

  • @thomas.gauroy,

    The reason you are getting Error 403 is because the gatewayhost which you are using for the API call is incorrect. Secondly, the Date format in the request header should be in English and not regional language.

    Please note :

    The below API calls will have gatewayhost : rms-world-check-one-api-pilot.thomsonreuters.com

    SEQ-pre-groups: Get my top-level groups
    SEQ-pre-group: Get a specific group by ID
    SEQ-pre-group-case-template: Get the case template for a group
    SEQ-pre-country-list: Get the ISO country list

    The below API calls will have gatewayhost: zfs-world-check-one-api-pilot.thomsonreuters.com

    SEQ-zfs-api-sync-screen-simple: Perform Zero Footprint Synchronous Screening: Simple
    SEQ-zfs-api-zfs-case-investigate-world-check-profile: Get a World-Check profile

    Hope this helps.