Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User credentials are incorrect. Incorrect API key or IP address. #160

Closed
1 task
sankarcn opened this issue Sep 3, 2018 · 1 comment
Closed
1 task

Comments

@sankarcn
Copy link

sankarcn commented Sep 3, 2018

Steps to reproduce:

1.Created an API Key using
https://public-api.sandbox.bunq.com/v1/sandbox-user
2. Then tried to create an installation context using below PHP code.
require_once DIR . '/vendor/autoload.php';
use bunq\Context\ApiContext;
use bunq\Util\BunqEnumApiEnvironmentType;

$environmentType = BunqEnumApiEnvironmentType::SANDBOX(); // Can also be BunqEnumApiEnvironmentType::PRODUCTION();
$apiKey = 'XXXXXXXXX'; // Replace with your API key
$deviceDescription = 'Testing of BUNQ'; // Replace with your device description
$permittedIps = ['0.0.0.0']; // List the real expected IPs of this device or leave empty to use the current IP

$apiContext = ApiContext::create(
$environmentType,
$apiKey,
$deviceDescription,
$permittedIps
);

BunqContext::loadApiContext($apiContext);
$fileName = 'bunq.cfg'; // Replace with your own secure location to store the API context details
$apiContext->save($fileName);

What should happen:

  1. bunq.cfg file should get created.

What happens:

  1. I got error with both by keeping the API Key recieved AS IS and also removing the "sandbox_" prefix of the api key.

Traceback

Fatal error: Uncaught bunq\Exception\BadRequestException: HTTP Response Code: 400 The response id to help bunq debug: 97537c35-c215-4e5d-b7da-ae1718e3ec91 Error message: User credentials are incorrect. Incorrect API key or IP address. in C:\xampp\htdocs\vendor\bunq\sdk_php\src\Exception\ExceptionFactory.php:52 Stack trace: #0 C:\xampp\htdocs\vendor\bunq\sdk_php\src\Http\Handler\ResponseHandlerError.php(54): bunq\Exception\ExceptionFactory::createExceptionForResponse(Array, 400, '97537c35-c215-4...') #1 C:\xampp\htdocs\vendor\bunq\sdk_php\src\Http\Handler\HandlerUtil.php(42): bunq\Http\Handler\ResponseHandlerError->execute(Object(GuzzleHttp\Psr7\Response)) #2 C:\xampp\htdocs\vendor\guzzlehttp\promises\src\FulfilledPromise.php(39): bunq\Http\Handler\HandlerUtil::bunq\Http\Handler{closure}(Object(GuzzleHttp\Psr7\Response)) #3 C:\xampp\htdocs\vendor\guzzlehttp\promises\src\TaskQueue.php(47): GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise{closure}() #4 C:\xampp\htdocs\vendor\guzzlehttp\promises\src\Promise.php(246): in C:\xampp\htdocs\vendor\bunq\sdk_php\src\Exception\ExceptionFactory.php on line 52

SDK version and environment

  • Tested on Latest version of GITHUB
  • Sandbox

Response id

  • Response id:abd746a1-fccc-478f-a594-3127c3ab77f1 (When using "sandbox_" prefix of api key
  • Response id:97537c35-c215-4e5d-b7da-ae1718e3ec91 (Without using "sandbox_" prefix of api key

Extra info:

@OGKevin
Copy link
Contributor

OGKevin commented Sep 3, 2018 via email

@sankarcn sankarcn closed this as completed Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants