Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

401 Unauthorized on v2 #66

Open
DrRoach opened this issue Sep 3, 2019 · 3 comments
Open

401 Unauthorized on v2 #66

DrRoach opened this issue Sep 3, 2019 · 3 comments

Comments

@DrRoach
Copy link

DrRoach commented Sep 3, 2019

I use v2 of this repo and for some reason all API requests to live klarna are returning a 401 unauthorised response.

I have checked the API keys being used and verified that they are valid via curl and I can see that the auth headers being set on the sendRequest() call are also correct.

Is v2 still supported? Any ideas what's going on?

@Feijs
Copy link
Contributor

Feijs commented Sep 4, 2019

Is v2 still supported? Any ideas what's going on?

Not actively no

I have checked the API keys being used and verified that they are valid via curl and I can see that the auth headers being set on the sendRequest() call are also correct.

Just to check the obvious:

  • Are you setting testMode to false?
  • Is the correct API version being used (EU vs. NA)
  • Is the auth header you see being set on sendRequest of the form Authorization => Basic base-64-encoded-username-and-secret ?

@DrRoach
Copy link
Author

DrRoach commented Sep 5, 2019

Thanks for the response.

testMode is definitely false, 401 logs are appearing in the live klarna site.

Yes the EU version is being used for all requests: api.klarna.com.

This last one may be the cause of the issue, the guzzle auth value is being used but that looks like it's using basic auth and may not be encoding the values? I will try manually setting the auth header with encoding to see if that makes any difference.

@Feijs
Copy link
Contributor

Feijs commented Sep 5, 2019

@DrRoach could you try with this branch?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants