Code : 1005,"Security Data : UsernameToken authentication failed"
zdivyesh opened this issue · 7 comments
You need to add the SOAP key in the encryption
Facing same issue, can you please check? or guide where I need to update what
You need to add the SOAP key in the encryption
I am using the SOAP transaction key and getting the same error. Any idea what I should use for api_login_id field?
as found here: https://github.com/CyberSource/cybersource-android-sdk
You need to add the SOAP key in the encryption
I am using the SOAP transaction key and getting the same error. Any idea what I should use for api_login_id field?
as found here: https://github.com/CyberSource/cybersource-android-sdk
Managed to successfully encrypt card details.
The api_login_id is your Merchant ID which you can get from the business center
I am getting same error when I am adding amount variable in 'MessageSignature'.
I checked out this repo and just performed basic transaction using this code. In the transaction dashboard, I can see the transaction details but not able to see amount and currency. So in the 'generateSignature' method, while creating string 'signatureComponents' I added amount. On clicking 'Encrypt' its giving this Error Code 1005
```
String signatureComponents = stringHmacSha1
+ loginId + transactionObject.getMerchantReferenceCode()
+ amount // ----------------- Adding this is giving error 1005 --------------------------------------
+ timeStamp;
Kindly let me know, if this is correct way to see amount in transactions.
I am getting same error when I am adding amount variable in 'MessageSignature'.
I checked out this repo and just performed basic transaction using this code. In the transaction dashboard, I can see the transaction details but not able to see amount and currency. So in the 'generateSignature' method, while creating string 'signatureComponents' I added amount. On clicking 'Encrypt' its giving this Error Code 1005String signatureComponents = stringHmacSha1 + loginId + transactionObject.getMerchantReferenceCode() + amount // ----------------- Adding this is giving error 1005 -------------------------------------- + timeStamp;
Kindly let me know, if this is correct way to see amount in transactions.
This is an authentication error. In order to make a successful call to the api you have to generate a signature to sign your call to the api.
After getting user card and billing data, use the inapp sdk to encrypt the user data before passing it to your server for transaction processing, this will help reduce your PCI burden.
To encrypt the data you have to create a message signature (server side) using:
- Your soap transaction key, get this from your sandbox/live environment
- Merchant ID/API Login Id,
- Merchant reference code (this can be any significant string like project name)
- UTC timestamp of the transaction.
First create a HMAC-SHA1 of the soap transaction key. Then create a string concatenation of the HMAC-SHA1, your Merchant ID, a Merchant reference code and UTC timestamp:
String signatureComponents = transactionKeySha1 + Merchant Id + Merchant reference code + timestamp;
Next create a HMAC-SHA256 of the signatureComponents String. The result is your message signature.
The MessageSignature class in the inapp sdk samples shows you how to generate the signature in java so you can transform the code to whichever language you need for your server. In my case I did it in PHP.
After generating a signature you can make a call to the api to encrypt card data passing in your signature:
apiClient.performApi(InAppSDKApiClient.Api.API_ENCRYPTION,
transactionObject, signature);
If your signature is valid your call will be authenticated and processed.
I hope this helps.
I am getting same error when I am adding amount variable in 'MessageSignature'.
I checked out this repo and just performed basic transaction using this code. In the transaction dashboard, I can see the transaction details but not able to see amount and currency. So in the 'generateSignature' method, while creating string 'signatureComponents' I added amount. On clicking 'Encrypt' its giving this Error Code 1005String signatureComponents = stringHmacSha1 + loginId + transactionObject.getMerchantReferenceCode() + amount // ----------------- Adding this is giving error 1005 -------------------------------------- + timeStamp;
Kindly let me know, if this is correct way to see amount in transactions.
You don't need to add amount. If you look carefully in the MessageSignature.java, you will see that they did not use amount.