cancel
Showing results for 
Search instead for 
Did you mean: 

Accept.js returns E_WC_21 error even with correct login/key

I am testing our integration with authorize.net. I have two test accounts on sandbox.authorize.net (one for USD and one for GBP).

 

I am using the https://jstest.authorize.net/v1/Accept.js library for our testing.

 

In my testing the Accept.dispatchData method returns the E_WC_21 error even with a valid API login and public client key.

 

I've double checked against the accounts on sandbox.authorize.net.

 

I generated a new public client key and tried that but I am getting the same error.

 

Does it take a while for a new public client key to become "live"?

 

Thanks,

 

Brad

bkembree
Member
1 ACCEPTED SOLUTION

Accepted Solutions

I got grumpy and made my own sandbox and  public key and it works now-

 

That old public client key was old or something?

 

So I will have to get this client to regenerate thier keys.

 

The public client key will not impact anything else. They are very nervous.

 

Thanks I am not a dork thanks!  Moving on now ..

View solution in original post

17 REPLIES 17

Hi @bkembree

 

Can you double check you passing the correct combination of  apiLoginID and clientKey per account ?

 

https://developer.authorize.net/api/reference/features/acceptjs.html 

 

E_WC_21 User authentication failed due to invalid authentication values. Either the API Login ID or Public Client Key, or both values, are incorrect. The value of apiLoginIDmust be same as the ID that you use to authenticate API requests. The value for clientKey can be obtained through the Authorize.Net Merchant Interface, by navigating to Account > Settings > Security Settings > General Security Settings > Manage Public Client Key.




Send feedback at developer_feedback@authorize.net
Anurag
Moderator Moderator
Moderator

Yes, as I said in my initial post I have double checked the values for login id and public key.

 

I generated new public api keys and used those.

 

I just now once again double checked what I am submitting against the accounts on https://sandbox.authorize.net/ and they match 100% as far as I can see.

 

 

Help 

 
I am stuck on an emergency accept.js conversion (coldfusion) to the hosted form using javascript.
 
So the creds ID and KEY  work on this page : https://developer.authorize.net/api/reference/index.html
 
But when I submit them to the accept.js in test mode they are throwing this error:
  <button type="button"
class="AcceptUI"
data-billingAddressOptions='{"show":true, "required":false}'
data-apiLoginID="ZZZZZZZZZ"
data-clientKey="ZZZZZZZZZZZZZZZZZ"
data-acceptUIFormBtnTxt="Submit"
data-acceptUIFormHeaderTxt="Card Information"
data-responseHandler="responseHandler">Pay
</button>
 
<script type="text/javascript"
    charset="utf-8">
</script>
 
 
I am getting this in the response error

E_WC_21: User authentication failed due to invalid authentication values.

 
 
I am not sure - what to do - 
Madeleine
Contributor

@Madeleine Could you be more specific about Test Mode?  Did you switch your sandbox to test mode instead of live mode, or are you describing a request sent to the sandbox?

 

Richard

The client gave me the ID an KEY I do not have access - here is what client sent me..and other programmers..  on task

_________________________________________

I rolled back to version r and the old url and production values work.

Sandbox account WORKING

https://apitest.authorize.net/xml/v1/request.api

API Login ID: 83u6---DWd

Transaction Key: 6S345vpd6WXtXp96

_______________________________________

 

They work here https://developer.authorize.net/api/reference/index.html

 

{
    "authenticateTestRequest": {
        "merchantAuthentication": {
            "name": "83u6---DWd",
            "transactionKey": "6S345vpd6WXtXp96"
        }
    }
}
{
    "messages": {
        "resultCode": "Ok",
        "message": [
            {
                "code": "I00001",
                "text": "Successful."
            }
        ]
    }
}

 

SO -------

 

I am trying to do a Hosted form Accept.js - my CFML screen seems to be working JSON it works but my response handler in console returns this:  See the script I am calling here: jstest.

 

<script type="text/javascript" src="https://jstest.authorize.net/v3/AcceptUI.js" charset="utf-8">
</script>

 

E_WC_21: User authentication failed due to invalid authentication values.

 

What is wrong?  Is it the Mode of the Sandbox?  I can ask them to change that?

 

Thanks!

Madeleine

@Madeleine Use this call in the API Reference with your sandbox credentials, it will tell you if the sandbox is in test mode.

 

https://developer.authorize.net/api/reference/#transaction-reporting-get-merchant-details

So not in test mode 

 

<?xml version="1.0" encoding="utf-8"?>
<getMerchantDetailsResponse xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<messages>
<resultCode>Ok</resultCode>
<message>
<code>I00001</code>
<text>Successful.</text>
</message>
</messages>
<isTestMode>false</isTestMode>
<processors>
<processor>
<name>First Data Nashville</name>
</processor>
</processors>
<merchantName>fwHGwSdCaR</merchantName>
<gatewayId>565697</gatewayId>
<marketTypes>
<marketType>eCommerce</marketType>
</marketTypes>
<productCodes>
<productCode>CNP</productCode>
</productCodes>
<paymentMethods>
<paymentMethod>AmericanExpress</paymentMethod>
<paymentMethod>DinersClub</paymentMethod>
<paymentMethod>Discover</paymentMethod>
<paymentMethod>EnRoute</paymentMethod>
<paymentMethod>JCB</paymentMethod>
<paymentMethod>Mastercard</paymentMethod>
<paymentMethod>Visa</paymentMethod>
</paymentMethods>
<currencies>
<currency>USD</currency>
</currencies>
<publicClientKey>9aptdYwtHt2F22XLRgr4B9AM4Pkt5eb6b6MC9d2Nn3m3YEptx3RFFuXmpYWDLHev</publicClientKey>
</getMerchantDetailsResponse>

Hello

 

is it the following??????

 

The important thing to remember, though, is that you're not using your regular sandbox transaction key to use Accept.js. If that's what you're trying with Accept.js, that would explain the error.

 

Any credentials you use for Accept.js will be exposed in the browser, so we have you use a special client key that's only for Accept. That way, someone taking your credentials out of the browser would only be able to use them to generate card tokens, not for any transaction processing or anything like that.

 

We call his special client key the "public client key". If you haven't already, go back to the documentation and read through the section "Obtaining a Public Client Key". That will walk you through the steps of generating a public client key to use with Accept.js.

 

Tried the public Client Key no beans same error - any  Helpful ideas?  

 

<button type="button"
class="AcceptUI"
data-billingAddressOptions='{"show":true, "required":false}'
data-apiLoginID="83u---DWd"
data-clientKey="9aptdYwtHt2F22XLRgr4B9AM4Pkt5eb6b6MC9d2Nn3m3YEptx3RFFuXmpYWDLHev"
data-acceptUIFormBtnTxt="Submit"
data-acceptUIFormHeaderTxt="Card Information"
data-responseHandler="responseHandler">Pay
</button>
</form>