Re: Getting intermittent API error "Invalid Username provided for Basic Auth API access"

Solved

Getting intermittent API error "Invalid Username provided for Basic Auth API access"

DanAtBonify
Shopify Partner
57 4 38

I'm wondering if anyone from the Shopify API team can help us identify why we get this error in some REST API calls randomly.

 

I have a few different public Shopify apps that perform hundreds of API calls per minute across our customer's stores.

 

Occasionally we get the following error back when trying to perform various types of API calls:

[API] Invalid Username provided for Basic Auth API access

 

I have confirmed that the "Username" provided in the Basic Auth field (which is the app API Key) is valid at the time of the request.

 

If I re-run the API request it works, almost like the error was just a temporary blip.

 

Here are some request IDs where we received that error:

 

  • 52856a0e-23d4-42f6-bae7-3fabaf912bdc
  • d8f909ba-3323-4e95-b8b8-daf18ba12889
  • 3f251221-5430-426d-8e5d-709138b54edd
  • 68d64d60-bbdb-4269-8e15-aac7167789c2
  • e36ad88b-f815-4fc5-84bc-e16af8b71323

Feel free to DM me. Thanks!

Accepted Solution (1)

csam
Shopify Staff (Retired)
267 40 51

This is an accepted solution.

Hi @DanAtBonify 

 

Does your application have logging for the full outgoing request including the authorization headers? Could you please confirm that the API key (username) is the same for failed and succeeded requests? I am seeing an error message in our logs indicating that it does not match the expected key. If you'd like, you can submit a more in depth support request through the partner dashboard under "Report an issue" including the API key(s) being used by your app(s). Please do *not* include the password.

 

Regards,

 

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 2 (2)

csam
Shopify Staff (Retired)
267 40 51

This is an accepted solution.

Hi @DanAtBonify 

 

Does your application have logging for the full outgoing request including the authorization headers? Could you please confirm that the API key (username) is the same for failed and succeeded requests? I am seeing an error message in our logs indicating that it does not match the expected key. If you'd like, you can submit a more in depth support request through the partner dashboard under "Report an issue" including the API key(s) being used by your app(s). Please do *not* include the password.

 

Regards,

 

To learn more visit the Shopify Help Center or the Community Blog.

DanAtBonify
Shopify Partner
57 4 38
I am seeing an error message in our logs indicating that it does not match the expected key

Thank you! That helped me find the issue which was we were sending a different access token with the API Key.