401 Unauthorized error with correct credentials.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- java
- Domain
- api, authentication
Research direction
Start by comparing the properties in getMyMerchantDetails() with the working getMerchantDetails() example, focusing on the merchant ID, key ID, secret key, authentication type, and run environment. Reproduce the request against https://apitest.cybersource.com/pts/v2/payments and verify that the corrected configuration returns the expected 201 response instead of 401 Unauthorized.
Written by the indexing model from the issue text.
Description
I followed the documentation and set up my API credentials as below:
public static Properties getMyMerchantDetails() {
Properties props = new Properties();
// HTTP_Signature = http_signature and JWT = jwt
props.setProperty("authenticationType", "http_signature");
props.setProperty("merchantID", "my_web_au");
props.setProperty("runEnvironment", "apitest.cybersource.com");
props.setProperty("merchantKeyId", "my_merchant_id");
props.setProperty("merchantsecretKey", "my_sercret_key");
props.setProperty("useMetaKey", "false");
props.setProperty("enableClientCert", "false");
return props;
}
it gives me 401 unauthorized error:
Response{protocol=http/1.1, code=401, message=Unauthorized, url=https://apitest.cybersource.com/pts/v2/payments}
public static Properties getMerchantDetails() {
Properties props = new Properties();
// HTTP_Signature = http_signature and JWT = jwt
props.setProperty("authenticationType", "http_signature");
props.setProperty("merchantID", "testrest");
props.setProperty("runEnvironment", "apitest.cybersource.com");
props.setProperty("requestJsonPath", "src/main/resources/request.json");
props.setProperty("useMetaKey", "false");
// HTTP Parameters
props.setProperty("merchantKeyId", "ggggggggggg");
props.setProperty("merchantsecretKey", "gggggggggg");
props.setProperty("enableClientCert", "false");
return props;
}
The above gives which is me 201 proper response.
I am sure my credentials are correctly created. Is there anything else I should add or modify to get past authorization?
- Dominant language
- Java
- Stars
- 35
- Forks
- 84
- Avg merge
- 37m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CyberSource/cybersource-rest-samples-java
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
CyberSource/cybersource-rest-samples-java#62 · 1 comment ·
All issues in CyberSource/cybersource-rest-samples-java
Similar issues
-
area/plugin
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
kestra-io/plugin-kestra#190 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/rocketmq-dashboard#5064 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
wso2/dpdp-accelerator#287 ·