Closed mvolpe-fvg closed 3 months ago
Buongiorno, i token da lei utilizzati non sono stati generati correttamente. Infatti, decodificandoli tramite il tool online jwt.io, compare il messaggio di errore "Invalid Signature":
Analizzando il data.json da lei riportato, sembrerebbe che non abbia generato correttamente il certificato p12 a partire da quello di firma e che stia utilizzando il certificato di autenticazione al suo posto:
Il certificato da utilizzare per la creazione del canale https è quello di autenticazione (A1XXXXXXXXX) mentre quello di firma (S1XXXXXXXXX) serve per firmare i token, come indicato nel seguente commento: https://github.com/ministero-salute/it-fse-support/issues/654#issuecomment-1985853383 Pertanto, nel data.json deve inserire il p12 generato a partire dal certificato di firma (S1XXXXXXXXX):
La rimandiamo al seguente screenshot con le istruzioni dettagliate per la costruzione del p12:
Risolto grazie.
Salve,
La richiesta di validazione ritorna invalid token, anche se il toke è stato generato con l'apposito tool jwt-generator.
Comando Curl:
curl.exe --cert-type P12 --cert C:\A1#111#TECHEMVSRLXX.p12:'password' -X 'POST' 'https://modipa-val.fse.salute.gov.it:443/govway/rest/in/FSE/gateway/v1/documents/validation' -H 'Authorization: Bearer eyJ4NWMiOlsiTUlJRmJEQ0NBMVNnQXdJQkFnSVVCZlhpeVlTdGNVMjRDWGJqSUNJSmI0UmdOaW93RFFZSktvWklodmNOQVFFTEJRQXdWekVuTUNVR0ExVUVBd3dlUTBFZ1RXbHVhWE4wWlhKdklHUmxiR3hoSUZOaGJIVjBaU0JVWlhOME1SOHdIUVlEVlFRS0RCWk5hVzVwYzNSbGNtOGdaR1ZzYkdFZ1UyRnNkWFJsTVFzd0NRWURWUVFHRXdKSlZEQWVGdzB5TkRBMU1ETXhORFV4TURGYUZ3MHlOekExTURReE5EVXhNREJhTUcweEN6QUpCZ05WQkFZVEFrbFVNUjh3SFFZRFZRUUtEQlpOYVc1cGMzUmxjbThnWkdWc2JHRWdVMkZzZFhSbE1SOHdIUVlEVlFSaERCWkRSanBKVkMxUVVrOVdRVmd3TUZnd01GZ3dNREJaTVJ3d0dnWURWUVFEREJOVE1TTXh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CqlWmgHnmwm0I7ICr4oBlsWDnCG52sdd5AS_a24oC2wOFWrkJRHIF6w-76uGaFB9WNAKhGjVnif3O4XCpLwk9DjJG2q7l8NcKR6h2_mnUYo-260ZwfmXizIpZqdgLp6BJMuSYcQ' -H 'accept: application/json' -H 'Content-Type: multipart/form-data' -F 'requestBody={\"healthDataFormat\": \"CDA\", \"mode\": \"RESOURCE\", \"activity\": \"VERIFICA\"}' -F 'file=@C:/finalPDFA3.pdf;type=application/pdf'
Response: {"type":"https://govway.org/handling-errors/401/TokenAuthenticationFailed.html","title":"TokenAuthenticationFailed","status":401,"detail":"Invalid token","govway_id":"16e29713-44e6-11ef-a6bf-005056ae7395"}
data.json: