question

Rahul avatar image
Rahul asked

getting AUTH_TOKEN_VERIFICATION_FAILURE: null: null amazon in app purchase fire stick tv


I am trying to implement amazon's in app purchase(IAP) in my application. I followed the below article to implement it. https://developer.amazon.com/docs/in-app-purchasing/iap-implement-iap.html

But I am receiving below error when I am calling PurchasingService.purchase(MySku.MY_MAGAZINE_SUBS.getSku());

    com.amazon.a.a.n.a.a.a: AUTH_TOKEN_VERIFICATION_FAILURE: null: null        at com.amazon.a.a.n.a.b.a(AuthenticationTokenVerifier.java:94)        at com.amazon.a.a.n.a.a.a(AbstractCommandTask.java:204)        at com.amazon.a.a.n.a.a.a(AbstractCommandTask.java:131)        at com.amazon.a.a.n.b.b$1.run(SimpleTaskPipeline.java:179)        at android.os.Handler.handleCallback(Handler.java:873)        at android.os.Handler.dispatchMessage(Handler.java:99)        at android.os.Looper.loop(Looper.java:193)        at android.os.HandlerThread.run(HandlerThread.java:65)

MySku.java

public enum MySku {     //The only subscription product used in this sample app    MY_MAGAZINE_SUBS("com.subscription.annually", "US");     private final String sku;    private final String availableMarkpetplace;     /**     * Returns the Sku string of the MySku object     *     * @return     */    public String getSku() {        return this.sku;    }     /**     * Returns the Available Marketplace of the MySku object     *     * @return     */    public String getAvailableMarketplace() {        return this.availableMarkpetplace;    }     private MySku(final String sku, final String availableMarkpetplace) {        this.sku = sku;        this.availableMarkpetplace = availableMarkpetplace;    }     /**     * Returns the MySku object from the specified Sku and marketplace value.     *     * @param sku     * @param marketplace     * @return     */    public static MySku fromSku(final String sku, final String marketplace) {        if (MY_MAGAZINE_SUBS.getSku().equals(sku) && (null == marketplace || MY_MAGAZINE_SUBS.getAvailableMarketplace()                .equals(marketplace))) {            return MY_MAGAZINE_SUBS;        }        return null;    } 
}

Please help!!!

iapfire tvamazon pay
1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I am having the same issue! running in production mode nothing is working for me. All requests (userData, getPurchaseUpdates and other) return RequestStatus = FAILED and I see exactly the same issue in my logs: com.amazon.a.a.n.a.a.a: AUTH_TOKEN_VERIFICATION_FAILURE: null: null

1 Like 1 ·
Levon@Amazon avatar image
Levon@Amazon answered

Hi there,

AUTH_TOKEN_VERIFICATION_FAILURE generally happens when Appstore SDK is not able to verify the Authentication token sent from Amazon servers. This generally happens when Public key (PEM file) is not available in the App. Kindly follow the steps mentioned in https://developer.amazon.com/docs/in-app-purchasing/integrate-appstore-sdk.html#configure_key to configure the key. Thanks!

2 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I have configured the key according the guide. If you don't do that you'll get different error:

D/Kiwi: AbstractCommandTask: Exception occurred while processing task: com.amazon.a.a.o.b.a.a: DATA_AUTH_KEY_LOAD_FAILURE: CERT_NOT_FOUND: null
com.amazon.a.a.o.b.a.a: DATA_AUTH_KEY_LOAD_FAILURE: CERT_NOT_FOUND: null

You'll get this error if remove AppstoreAuthenticationKey.pem from assets folder.

0 Likes 0 ·
Pradeep avatar image Pradeep Andrei Viarshadau ·

@Andrei Viarshadau I'm also having the same issue. (com.amazon.a.a.n.a.a.a: AUTH_TOKEN_VERIFICATION_FAILURE: null: null.) Did you find any solution?

0 Likes 0 ·
allentown avatar image
allentown answered

Did you solve it?I also encountered the same problem

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

No, still not resolved. Currently I've postponed the update to new sdk.

0 Likes 0 ·
Andrei Viarshadau avatar image
Andrei Viarshadau answered

So, after lots of investigation I finally made it working!

Here what you need to know, to make Production mode working:

1) It only works in Life App Testing! So Production mode will work only for apk that was downloaded from the store during LAT.

2) Make sure, that your AppstoreAuthenticationKey.pem is up to date. I my case for some reason it has changed after I initially downloaded it.

3) Follow other documentation guides.


As for @Rahul original question - I think you are trying to test in Production mode locally with you debug build. It will not work! You should test locally in Sandbox mode using App Tester User Guide

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.