NPPS012 error

evgeny_t
Occasional Visitor

NPPS012 error

Hello!

I successfully configured Postman to send visa direct request.

After that I set to "Enforced" method getAlias and trying to re-config the Postman:

added keyId param with value from my project and crypt the payload

public static String getEncryptedPayload(String keyId, String mleServPubPath, String requestPayload) throws CertificateException, JOSEException, IOException {

JWEHeader.Builder headerBuilder = new JWEHeader.Builder(JWEAlgorithm.RSA_OAEP_256, EncryptionMethod.A128GCM);
headerBuilder.keyID(keyId);
headerBuilder.customParam("iat", System.currentTimeMillis());
JWEObject jweObject = new JWEObject(headerBuilder.build(), new Payload(requestPayload));
jweObject.encrypt(new RSAEncrypter(getRSAPublicKey(mleServPubPath)));
return "{\"encData\":\"" + jweObject.serialize() + "\"}";
}

 

But test is failed:

--header 'keyId: 83d7c272-...-2eb06c67d70c' \
--header 'Authorization: Basic WTNDOTFITUFGUElW...wdzppMDVadldB' \
--header 'Content-Type: application/json' \
--data-raw '{"encData":"eyJlbmMiOiJBMTI4R0NNIiwiaWF0IjoxNjIwMTExMDY2NTQ2LCJhbGciOiJSU0EtT0FFUC0yNTYiLCJraWQiOiI4M2Q3YzI3Mi0wZjM1LTRiZmUtYjViMy0yZWIwNmM2N2Q3MGMifQ.Vqh_0ka9owTUK_N34x7jJY_SZKAqxHNP3vGau_quMunETbkCD1JWJVhBRD-Up0qLc5_NJO19fziw6ms1RD0df99dKVdOwp8dvQlyPoVMqTCSSbReKXgpfv3ng8P14mo75MIiK3Wz7lF6Sew8_SQZzYMH3aOiN1fFfdS-4b-GqUa8HmdN6QQO4cuqRPa13kSLFhiAO2CmIXxuI4VMt1zAsBEjC9me18kWCksBalfx1uoFbdWIlTs9U9lnkMAOhtKryRarU86hlB8Yof97g3DZJzIdSxrwjwXKx_5hyrWK-ahCPzVzV1Y0KTErj5iW8K7RAVAkIL7L8rDSYS1y19xu8Q.y7Tzh7ShHh2I-DhS.xnbwJn5MTDJ163okUVAHFtYyURZ8nDPxBzPAsOitikrB9hNO1psVlU-Lkw-WD94HBnd6Myf9PSMm2hp1QUz0z218jnRfVCef4qs.00RTEIgT9_Ek2VkgVE2Z2Q"
}'
 
Response is 
{
"status": "BAD_REQUEST",
"code": "NPPS012",
"message": "Bad request"
}
 
(in response header:
X-CORRELATION-ID: 1620111092_271_2048242942_l55c013_VDP_WS)
 
Where am I wrong?:(
1 REPLY 1
SLi
Visa Dev Moderator
Visa Dev Moderator

Re: NPPS012 error

Hi @evgeny_t,

 

Please share the following information and we'll take a look. Thank you.

 

1.Request Header

2.Request Body (unencrypted)
3. Response Header (include the x-correlation-id)
4. Response Body (unencrypted)


Best,
Stacey

Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.