ministero-salute / it-fse-support

https://ministero-salute.github.io/it-fse-support/
34 stars 20 forks source link

HTTP status 401 Unauthorized #343

Closed archimedaouc closed 1 year ago

archimedaouc commented 1 year ago

Errore di autenticazione chiamando in POST l'endpoint

https://modipa-val.fse.salute.gov.it/govway/rest/in/FSE/gateway/v1/documents/validation
FSE-JWT-Signature: eyJ4NWMiOlsiXHJNSUlGYURDQ0ExQ2dBd0lCQWdJVVFtbTBRTnY1QjNaam1ycmtwUk5pNURjOFJzMHdEUVlKS29aSWh2Y05BUUVMXHJCUUF3VnpFbk1DVUdBMVVFQXd3ZVEwRWdUV2x1YVhOMFpYSnZJR1JsYkd4aElGTmhiSFYwWlNCVVpYTjBNUjh3XHJIUVlEVlFRS0RCWk5hVzVwYzNSbGNtOGdaR1ZzYkdFZ1UyRnNkWFJsTVFzd0NRWURWUVFHRXdKSlZEQWVGdzB5XHJNekEwTWpReE5USTBOVFJhRncweU5qQTBNalF4TlRJME5UTmFNR2t4Q3pBSkJnTlZCQVlUQWtsVU
1SOHdIUVlEXHJWUVFLREJaTmFXNXBjM1JsY204Z1pHVnNiR0VnVTJGc2RYUmxNUjB3R3dZRFZRUmhEQlJEUmpwSlZDMHdPVEE1XHJNRE13TURBd01EQllXREVhTUJnR0ExVUVBd3dSVXpFak1Ea3dPVEF6TURBd01EQXdXRmd3Z2dFaU1BMEdDU3FHXHJTSWIzRFFFQkFRVUFBNElCRHdBd2dnRUtBb0lCQVFEYnR6Z0N0d2pzd2RXT1I2OUZvaXhtOWNlY3h3SlpUZDVqXHJvVEhQbGR2ODlJUVdNdHMwcWN5SG1CTDRvbkxkbmJnZ2d4WUdrck5SNHRyRnFhVkwvcXllWHl5UTFP
YXdEblRsXHJhM1crZnBxdjNTSENHZ3hwREJTTGNDbGdSa3hoQzdJTG1HdVI4OTFMMm0yWkZ2TGQ1NkdrZVRna1J6cWUyaHZ1XHIzTUdVZlgyRUlXMnFmVktEUklIVC9Well5S3pBYWNRVmQyaUVZbVRiby9NdUh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pcGEtdmFsLmZzZS5zYWx1dGUuZ292Lml0L2dvdndheS9yZXN0L2luL0ZTRS9nYXRld2F5L3YxIiwicGF0aWVudF9jb25zZW50Ijp0cnVlLCJhY3Rpb25faWQiOiJDUkVBVEUiLCJyZXNvdXJjZV9obDdfdHlwZSI6IignMzQxMDUtN15eMi4xNi44NDAuMS
4xMTM4ODMuNi4xJykiLCJzdWJqZWN0X2FwcGxpY2F0aW9uX2lkIjoiQXJjaGlNZWQiLCJleHAiOjE2ODQzOTExMjksInN1YmplY3RfYXBwbGljYXRpb25fdmVuZG9yIjoiQXppZW5kYSBPc3BlZGFsaWVyby1Vbml2ZXJzaXRhcmlhIENhcmVnZ2kiLCJpYXQiOjE2ODQzMDQ3MjksImp0aSI6IjdjYWI0ZTVjLWY0N2ItMTFlZC1hMDViLTAyNDJhYzEyMDAwMyIsInBlcnNvbl9pZCI6IlRTVFNNTjYzQTAxRjIwNUheXl4mMi4xNi44NDAuMS4xMTM4ODMuMi45LjQuMy4yJklTTyJ9.AD2ClZQFcNt0bcxqM0GinhFs4tMZjlfU5AY2fMMqCXFQCBbisl9dKvqn2wBn0YzrfIV3Q5-T0nWy1Go_ydZu0vxJFMmfcBVf-p3E76bL_xi9s-rZUVS2rqbpvayvYaQwsZaU3AyP7W3VfXjz9vXc8jPPfeVH1Rmyem7m1nYK5MAH8w78xs__u55KRbfMwfa4tWUN7lRHNIziK97HdG3h_X_7Y1mYlddhGWDi0hPSYZ42tU2lmuEKkMfxm2gzgpcXwUXb2gN72s6uFmhO49L3wBJaUGYffC1slrGGuI6kEPy_O0tOG17l6rAQYXWEQzcFyJfbU5yL_6UYIwYuA8Wb9w

----------------------------000000000000000000000000 Content-Disposition: form-data; name="requestBody"; Content-Type: application/json

{ "healthDataFormat": "CDA", "mode": "ATTACHMENT", "activity": "VERIFICA" } ----------------------------000000000000000000000000 Content-Disposition: form-data; name="file"; filename="ldo.pdf" Content-Type: application/octet-stream

< .\ldo-archimed-5.pdf ----------------------------000000000000000000000000--


* Risposta

HTTP/1.1 401 Unauthorized X-Backside-Transport: FAIL FAIL Connection: Keep-Alive Transfer-Encoding: chunked Expires: 0 Cache-Control: no-cache, no-store, must-revalidate Server: GovWay-SOGEI Pragma: no-cache GovWay-Transaction-ErrorType: TokenAuthenticationFailed GovWay-Transaction-ID: f9f45ceb-f46c-11ed-80ae-005056ae7395 Date: Wed, 17 May 2023 06:26:42 GMT WWW-Authenticate: Bearer realm="FSE-JWT-Signature", error="invalid_token", error_description="Token invalid" Vary: * X-Content-Type-Options: nosniff Content-Type: application/problem+json X-Global-Transaction-ID: 3f7e3e2d646473a291d426ed

{ "type": "https://govway.org/handling-errors/401/TokenAuthenticationFailed.html", "title": "TokenAuthenticationFailed", "status": 401, "detail": "Invalid token", "govway_id": "f9f45ceb-f46c-11ed-80ae-005056ae7395" }



La stessa chiamata, ovviamente utilizzando token fake, andava a buon fine utilizzando il gateway di test in Docker.

Grazie per il supporto.
masciamariotti commented 1 year ago

Buon pomeriggio, dovrebbe verificare come sta inviando i parametri dell' header: da una prima analisi sembrerebbe che i token siano suddivisi in più righe, rendendo di fatto impossibile la decodifica degli stessi.

archimedaouc commented 1 year ago

Buongiorno.

Ho scaricato la versione appena rilasciata del JwtGenerator (0.0.4-SNAPSHOT) e ho redirezionato l'output su un file di testo:

java -jar jwt-generator-0.0.4-SNAPSHOT.jar -d data3.json -a sign -p archimedaouc 2>token3.txt

Ho quindi copiato e incollato i token dal file generato nel mio client per eseguire le richieste (uso PhpStorm) assicurandomi che fossero entrambi su una riga. Questa è la richiesta:

POST https://modipa-val.fse.salute.gov.it/govway/rest/in/FSE/gateway/v1/documents/validation
Authorization: Bearer eyJ4NWMiOlsiXHJNSUlGYURDQ0ExQ2dBd0lCQWdJVVFtbTBRTnY1QjNaam1ycmtwUk5pNURjOFJzMHdEUVlKS29aSWh2Y05BUUVMXHJCUUF3VnpFbk1DVUdBMVVFQXd3ZVEwRWdUV2x1YVhOMFpYSnZJR1JsYkd4aElGTmh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E2ODQ0ODE5MDYsInN1YmplY3RfYXBwbGljYXRpb25fdmVuZG9yIjoiQXppZW5kYSBPc3BlZGFsaWVyby1Vbml2ZXJzaXRhcmlhIENhcmVnZ2kiLCJpYXQiOjE2ODQzOTU1MDYsImp0aSI6IjdjYWI0ZTVjLWY0N2ItMTFlZC1hMDViLTAyNDJhYzEyMDAwMyIsInBlcnNvbl9pZCI6IlRTVFNNTjYzQTAxRjIwNUheXl4mMi4xNi44NDAuMS4xMTM4ODMuMi45LjQuMy4yJklTTyJ9.2KWUSHPy-v_pD6cDatQT57c0KIyvFYOj9KSyBxZPTCUl9Lsm-PahBwxdiJcXqf4lbENEMGFOOvd_HEVvp8mgocoTg4HZpewIj5H0rn-gBhRDQLvlElma1AcwqVBfh9jlXvG3vdUj8rL5aZplRTse3r3DOnTMr31oirtr9KqcyExDlNsbeuG0L2kXDqtYL1KZawv23-HKEw04M0KT7WYzE2vkiKwJs0eOLdfJ4yMdVfDLRYdJJC_9cNmVv_KSbaAvlT6kLwH3tJnxQZ7_5u6NNSvcO13AWU5nWgdLiMlHENRkyfTnAjqW4BFTvJefkOGpoLVs9v2iVHN5YL7WtsXyaQ
Content-Type: multipart/form-data; boundary=--------------------------000000000000000000000000
Content-Length: 692911
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
Accept-Encoding: br,deflate,gzip,x-gzip

----------------------------000000000000000000000000
Content-Disposition: form-data; name="requestBody";
Content-Type: application/json

{
  "healthDataFormat": "CDA",
  "mode": "ATTACHMENT",
  "activity": "VERIFICA"
}
----------------------------000000000000000000000000
Content-Disposition: form-data; name="file"; filename="ldo.pdf"
Content-Type: application/octet-stream

< .\ldo-archimed-5.pdf
----------------------------000000000000000000000000--

Questa è la risposta:

POST https://modipa-val.fse.salute.gov.it/govway/rest/in/FSE/gateway/v1/documents/validation

HTTP/1.1 401 Unauthorized
X-Backside-Transport: FAIL FAIL
Connection: Keep-Alive
Transfer-Encoding: chunked
Expires: 0
Cache-Control: no-cache, no-store, must-revalidate
Server: GovWay-SOGEI
Pragma: no-cache
GovWay-Transaction-ErrorType: TokenAuthenticationFailed
GovWay-Transaction-ID: d2d1e143-f542-11ed-8882-005056ae54fa
Date: Thu, 18 May 2023 07:39:19 GMT
WWW-Authenticate: Bearer realm="FSE-JWT-Signature", error="invalid_token", error_description="Token invalid"
Vary: *
X-Content-Type-Options: nosniff
Content-Type: application/problem+json
X-Global-Transaction-ID: 3f7e3e2d6465d62692e18d7d

{
  "type": "https://govway.org/handling-errors/401/TokenAuthenticationFailed.html",
  "title": "TokenAuthenticationFailed",
  "status": 401,
  "detail": "Invalid token",
  "govway_id": "d2d1e143-f542-11ed-8882-005056ae54fa"
}
Response file saved.
> 2023-05-18T093919.401.json

Response code: 401 (Unauthorized); Time: 409ms (409 ms); Content length: 205 bytes (205 B)

Ho verificato su jwt.io sia il contenuto che la signature dei token ed entrambi sono validi.

Grazie.

masciamariotti commented 1 year ago

Buongiorno, dovrebbe verificare se sta generando i 2 token con il certificato corretto, l'errore riscontrato è Process 'x5c' error: parsing issue: malformed PEM data: no header found Ci conferma che sta utilizzando il certificato p12 per la generazione dei token? Specifichiamo che il certificato p12 va costruito a partire dal pem (il certificato che vi è stato condiviso tramite email dall'indirizzo fse_support@sogei.it). La rimandiamo ai seguenti link: 1; 2. Ci faccia sapere se il problema persiste, grazie.

archimedaouc commented 1 year ago

Buongiorno.

$ curl --cert auth.pem --key auth.key https://modipa-val.fse.salute.gov.it/govway/rest/in/FSE/gateway -i -v     
*   Trying 217.175.50.111:443...
* TCP_NODELAY set
* Connected to modipa-val.fse.salute.gov.it (217.175.50.111) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Request CERT (13):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS handshake, CERT verify (15):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: C=IT; ST=Roma; L=Roma; O=Sogei S.p.A.; CN=modipa-val.fse.salute.gov.it
*  start date: Jun  8 07:13:29 2022 GMT
*  expire date: Jun  8 07:13:20 2023 GMT
*  subjectAltName: host "modipa-val.fse.salute.gov.it" matched cert's "modipa-val.fse.salute.gov.it"
*  issuer: C=IT; ST=Bergamo; L=Ponte San Pietro; O=Actalis S.p.A.; CN=Actalis Organization Validated Server CA G3
*  SSL certificate verify ok.
> GET /govway/rest/in/FSE/gateway HTTP/1.1
> Host: modipa-val.fse.salute.gov.it
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
HTTP/1.1 404 Not Found
< Content-Type: application/problem+json
Content-Type: application/problem+json
< X-Global-Transaction-ID: 3f7e3e2d646c630297cc4aad
X-Global-Transaction-ID: 3f7e3e2d646c630297cc4aad
< X-Backside-Transport: FAIL FAIL
X-Backside-Transport: FAIL FAIL
< Connection: close
Connection: close

<
* TLSv1.2 (IN), TLS alert, close notify (256):
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, close notify (256):
{ "type": "https://govway.org/handling-errors/404/UnknownAPI.html", "title": "UnknownAPI", "status": 404, "detail": "Unknown API", "X-Global-Transaction-ID": "3f7e3e2d646c630297cc4aad" }
$ openssl req -in sign.csr -pubkey -noout -outform pem | sha256sum
26ede1323b94463f651499bf5e235e45e11331af9defff58d8cde4c632b538d0  -
$ openssl pkey -in sign.key -pubout -outform pem | sha256sum
26ede1323b94463f651499bf5e235e45e11331af9defff58d8cde4c632b538d0  -
$ openssl x509 -in S1090903000000XX_sign.pem -pubkey -noout -outform pem | sha256sum
26ede1323b94463f651499bf5e235e45e11331af9defff58d8cde4c632b538d0  -
$ openssl pkcs12 -export -name cert -out sign.p12 -inkey sign.key -in S1090903000000XX_sign.pem
Enter Export Password:
Verifying - Enter Export Password:
$ ls -l sign.p12
-rwxrwxrwx 1 filippo filippo 3038 May 23 08:31 sign.p12
java -jar jwt-generator-0.0.4-SNAPSHOT.jar -d data3.json -a cert -p ********* -v 
{
  "subject_role": "AAS",
  "purpose_of_use": "TREATMENT",
  "locality": "090903",
  "subject_application_vendor": "Azienda Ospedaliero-Universitaria Careggi",
  "subject_application_id": "ArchiMed",
  "subject_application_version": "V8",
  "subject_organization": "Regione Toscana",
  "subject_organization_id": "090",
  "patient_consent": true,
  "action_id": "CREATE",
  "resource_hl7_type": "('34105-7^^2.16.840.1.113883.6.1')",
  "person_id": "TSTSMN63A01F205H^^^&2.16.840.1.113883.2.9.4.3.2&ISO",
  "pem_path": "../csr/sign.pem",
  "p12_path": "../csr/sign.p12",
  "sub": "DNNBSM64M02Z229E^^^&2.16.840.1.113883.2.9.4.3.2&ISO",
  "aud": "https://modipa-val.fse.salute.gov.it/govway/rest/in/FSE/gateway/v1",
  "iss": "S1#090903000000XX",
  "jti": "7cab4e5c-f47b-11ed-a05b-0242ac120003"
}
 _____  _____  ___       __  _ _ _  _____    _____       _             
|   __||   __||_  |   __|  || | | ||_   _|  |     | ___ | |_  ___  ___ 
|   __||__   ||  _|  |  |  || | | |  | |    | | | || .'|| '_|| -_||  _|
|__|   |_____||___|  |_____||_____|  |_|    |_|_|_||__,||_,_||___||_|  

------------- Authorization Bearer Token ---------------
eyJ4NWMiOlsiXHJNSUlGYURDQ0ExQ2dBd0lCQWdJVVFtbTBRTnY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dYNjlxVBWmZQEXf5nrtQ7wsgOYPvPX
XT2w6airXFdvZ/1u5enPOPk+RRsAxJ7Y4zS6Mxv6ivY8BVVS1E1+dnnTsqGEHZnl
zR2FuduYrQaOT2J56YcLdeLB6L6ZXcTELEKRgunGlKjhq1RUi2lbcUnAoto+aVPt
QTmtByMfC7AXC6Fm2Gndo0UETBxA3YZIa1gxwSWpx7UltUZ0w5+JJM2xRTySe3Il
P4E1y28dl0sO/wM2jGs53+/Y0Efx2CjsvnmpzENw41n4IC/Tt9XP82gHkqm9heYO
5zssnOxAaae6lK6g1DxuTnXb+t4hU7MlWEWwT2CA7bfotZp6dr4243xwNugCTxka
BdaQ5y38YI/1qXVtHZ7OK0xmS85CnNBEsIJ2laWjQPt8pEhG3LWBm0SWPZxjTQAw
UwSbha/9E4Tt9bHs2OzmDxVT5BgYBIxtOsP+cZLAsQKcO0jkM8Lf5p+1XGsABWBA
PY2tkvQv3EKi+q3CCj7QdJZWCAebFpc8VM8JmGavedo96Nm7ckdnPOSmWco=

], typ=JWT, alg=RS256}
BODY: {sub=DNNBSM64M02Z229E^^^&2.16.840.1.113883.2.9.4.3.2&ISO, aud=https://modipa-val.fse.salute.gov.it/govway/rest/in/FSE/gateway/v1, iss=auth:S1#090903000000XX, exp=1684910213, iat=1684823813, jti=7cab4e5c-f47b-11ed-a05b-0242ac120003}
SIGNATURE: VALID

Validating Claims Token

HEADER: {x5c=[
MIIFaDCCA1CgAwIBAgIUQmm0QNv5B3ZjmrrkpRNi5Dc8Rs0wDQYJKoZIhvcNAQEL
BQAwVzEnMCUGA1UEAwweQ0EgTWluaXN0ZXJvIGRlbGxhIFNhbHV0ZSBUZXN0MR8w
HQYDVQQKDBZNaW5pc3Rlcm8gZGVsbGEgU2FsdXRlMQswCQYDVQQGEwJJVDAeFw0y
MzA0MjQxNTI0NTRaFw0yNjA0MjQxNTI0NTNaMGkxCzAJBgNVBAYTAklUMR8wHQYD
VQQKDBZNaW5pc3Rlcm8gZGVsbGEgU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nrtQ7wsgOYPvPX
XT2w6airXFdvZ/1u5enPOPk+RRsAxJ7Y4zS6Mxv6ivY8BVVS1E1+dnnTsqGEHZnl
zR2FuduYrQaOT2J56YcLdeLB6L6ZXcTELEKRgunGlKjhq1RUi2lbcUnAoto+aVPt
QTmtByMfC7AXC6Fm2Gndo0UETBxA3YZIa1gxwSWpx7UltUZ0w5+JJM2xRTySe3Il
P4E1y28dl0sO/wM2jGs53+/Y0Efx2CjsvnmpzENw41n4IC/Tt9XP82gHkqm9heYO
5zssnOxAaae6lK6g1DxuTnXb+t4hU7MlWEWwT2CA7bfotZp6dr4243xwNugCTxka
BdaQ5y38YI/1qXVtHZ7OK0xmS85CnNBEsIJ2laWjQPt8pEhG3LWBm0SWPZxjTQAw
UwSbha/9E4Tt9bHs2OzmDxVT5BgYBIxtOsP+cZLAsQKcO0jkM8Lf5p+1XGsABWBA
PY2tkvQv3EKi+q3CCj7QdJZWCAebFpc8VM8JmGavedo96Nm7ckdnPOSmWco=

], typ=JWT, alg=RS256}
BODY: {sub=DNNBSM64M02Z229E^^^&2.16.840.1.113883.2.9.4.3.2&ISO, subject_role=AAS, purpose_of_use=TREATMENT, iss=integrity:S1#090903000000XX, locality=090903, subject_application_version=V8, subject_organization=Regione Toscana, subject_organization_id=090, aud=https://modipa-val.fse.salute.gov.it/govway/rest/in/FSE/gateway/v1, patient_consent=true, action_id=CREATE, resource_hl7_type=('34105-7^^2.16.840.1.113883.6.1'), subject_application_id=ArchiMed, exp=1684910213, subject_application_vendor=Azienda Ospedaliero-Universitaria Careggi, iat=1684823813, jti=7cab4e5c-f47b-11ed-a05b-0242ac120003, person_id=TSTSMN63A01F205H^^^&2.16.840.1.113883.2.9.4.3.2&ISO}
SIGNATURE: VALID
POST https://modipa-val.fse.salute.gov.it/govway/rest/in/FSE/gateway/v1/documents/validation
Authorization: Bearer eyJ4NWMiOlsiXHJNSUlGYURDQ0ExQ2dBd0lCQWdJVVFtbTBRTnY1QjNaam1ycmtwUk5pNUR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I6IignMzQxMDUtN15eMi4xNi44NDAuMS4xMTM4ODMuNi4xJykiLCJzdWJqZWN0X2FwcGxpY2F0aW9uX2lkIjoiQXJjaGlNZWQiLCJleHAiOjE2ODQ5MTAyMTMsInN1YmplY3RfYXBwbGljYXRpb25fdmVuZG9yIjoiQXppZW5kYSBPc3BlZGFsaWVyby1Vbml2ZXJzaXRhcmlhIENhcmVnZ2kiLCJpYXQiOjE2ODQ4MjM4MTMsImp0aSI6IjdjYWI0ZTVjLWY0N2ItMTFlZC1hMDViLTAyNDJhYzEyMDAwMyIsInBlcnNvbl9pZCI6IlRTVFNNTjYzQTAxRjIwNUheXl4mMi4xNi44NDAuMS4xMTM4ODMuMi45LjQuMy4yJklTTyJ9.1oUaDhmn9jFvtWHAUQP8xdpo3hFujPTn1eMgFQS4yHsc3Oyp-O7qjlJlteNQ5ZRg2ginqM2US1DiphMHI6TptrWFg5TizeNi7HRzLjWqbCBQlK77uxaG4yZUxKyiWv5nWwNFB6bq2TlXbBlHztuT11Ttb6aX3QGUI91AikxqM1Z_QqaDoEWddRZ9YAMJIpkLjqn6BEuCgUe5uoAUo9S8DxboMINIE5Y9GQ5U_kfiiRX-Teim3mEqmroo7onpVtomEG-QL7VeqAduTLos7jirpW9dwHcVbrrAgwww6x4534W-UyyjTSAFxigFq-iISeEmBUQh7JirWhJp4UG0_FXDdA
Content-Type: multipart/form-data; boundary=--------------------------000000000000000000000000

----------------------------000000000000000000000000
Content-Disposition: form-data; name="requestBody";
Content-Type: application/json

{
  "healthDataFormat": "CDA",
  "mode": "ATTACHMENT",
  "activity": "VERIFICA"
}
----------------------------000000000000000000000000
Content-Disposition: form-data; name="file"; filename="ldo.pdf"
Content-Type: application/octet-stream

< .\ldo-archimed-5.pdf
----------------------------000000000000000000000000--
HTTP/1.1 401 Unauthorized
X-Backside-Transport: FAIL FAIL
Connection: Keep-Alive
Transfer-Encoding: chunked
Expires: 0
Cache-Control: no-cache, no-store, must-revalidate
Server: GovWay-SOGEI
Pragma: no-cache
GovWay-Transaction-ErrorType: TokenAuthenticationFailed
GovWay-Transaction-ID: 18869fda-f927-11ed-80ae-005056ae7395
Date: Tue, 23 May 2023 06:49:03 GMT
WWW-Authenticate: Bearer realm="FSE-JWT-Signature", error="invalid_token", error_description="Token invalid"
Vary: *
X-Content-Type-Options: nosniff
Content-Type: application/problem+json
X-Global-Transaction-ID: 3f7e3e2d646c61df97cb77cd

{
  "type": "https://govway.org/handling-errors/401/TokenAuthenticationFailed.html",
  "title": "TokenAuthenticationFailed",
  "status": 401,
  "detail": "Invalid token",
  "govway_id": "18869fda-f927-11ed-80ae-005056ae7395"
}
Response file saved.
> 2023-05-23T084903.401.json

Response code: 401 (Unauthorized); Time: 507ms (507 ms); Content length: 205 bytes (205 B)

Sinceramente non so dove sto sbagliando.

Grazie.

archimedaouc commented 1 year ago

Ho verificato i miei token con alcuni che ho trovato su Slack e ho visto che l'unica differenza era appunto la formattazione dell'header x5c.

Nel mio caso c'erano dei \r nel contenuto, mentre negli altri non erano presenti. Il problema è che proprio il jwt-generator inseriva questi \r, quindi ho creato in PHP il generatore dei token.

L'errore 401 non c'è più ma adesso viene fuori un errore 403 AuthorizationContentDeny

POST https://modipa-val.fse.salute.gov.it/govway/rest/in/FSE/gateway/v1/documents/validation

HTTP/1.1 403 Forbidden
X-Backside-Transport: FAIL FAIL
Connection: Keep-Alive
Transfer-Encoding: chunked
Expires: 0
Cache-Control: no-cache, no-store, must-revalidate
Server: GovWay-SOGEI
Pragma: no-cache
GovWay-Transaction-ErrorType: AuthorizationContentDeny
GovWay-Transaction-ID: 7e4c8c3c-fa1b-11ed-8882-005056ae54fa
Date: Wed, 24 May 2023 11:15:55 GMT
Vary: *
X-Content-Type-Options: nosniff
Content-Type: application/problem+json
X-Global-Transaction-ID: 3f7e3e2d646df1eb13883e8f

{
    "type": "https://govway.org/handling-errors/403/AuthorizationContentDeny.html",
    "title": "AuthorizationContentDeny",
    "status": 403,
    "detail": "Unauthorized request content",
    "govway_id": "7e4c8c3c-fa1b-11ed-8882-005056ae54fa"
}
archimedaouc commented 1 year ago

Dopo aver generato in autonomia i token e modificato alcuni dati seguendo i commenti su Slack, la richiesta HTTP va a buon fine.

Chiudo quindi la issue.