Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

401 Unauthorized error with correct credentials.

オープン
#63 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
java

調査の方向性

まず、getMyMerchantDetails() のプロパティを、動作する例である getMerchantDetails() と比較し、加盟店 ID、キー ID、シークレットキー、認証タイプ、実行環境に注目します。https://apitest.cybersource.com/pts/v2/payments に対するリクエストを再現し、修正後の設定が 401 Unauthorized ではなく、期待される 201 レスポンスを返すことを確認します。

索引モデルが issue の本文から書いたものです。

説明

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?

主要言語
Java
スター
35
フォーク
84
平均マージ
37分
マージ済み PR(30日)
1

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CyberSource/cybersource-rest-samples-java のほかの issue

CyberSource/cybersource-rest-samples-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。