gilokimu / WooDroid

Simple, robust Woocommerce API sdk for java and android
84 stars 39 forks source link

401 Unauthorized #19

Closed hmoshfegh closed 4 years ago

hmoshfegh commented 4 years ago

hi, i have this problem with wooDroid. what i must to do? please help me

        Woocommerce woocommerce = Woocommerce.Builder()
                .setSiteUrl("http://parstuts.ir")
                .setApiVersion(Woocommerce.API_V3)
                .setConsumerKey(ConstantValues.WOOCOMMERCE_CONSUMER_KEY)
                .setConsumerSecret(ConstantValues.WOOCOMMERCE_CONSUMER_KEY)
                .build();

[size=327 text={"code":"woocommerce_rest_authentication_error","message":"\\u062…]

D/OkHttp: {"code":"woocommerce_rest_authentication_error","message":"\u0627\u0645\u0636\u0627\u0621 \u0646\u0627\u0645\u0639\u062a\u0628\u0631 \u0627\u0633\u062a - \u0627\u0645\u0636\u0627\u06cc \u0627\u0631\u0627\u0626\u0647 \u0634\u062f\u0647 \u0645\u0637\u0627\u0628\u0642\u062a \u0646\u062f\u0627\u0631\u062f.","data":{"status":401}}
    <-- END HTTP (327-byte body)
D/OkHttp: <-- 401 Unauthorized http://parstuts.ir/wp-json/wc/v3/products
gilokimu commented 4 years ago

if you can slack or email me your keys, I can check on my end if the setup is fine

hmoshfegh commented 4 years ago

if you can slack or email me your keys, I can check on my end if the setup is fine

i email the keys for you

gilokimu commented 4 years ago

I tried it on my phone and I was able to connect to your website. And the setup here looks fine. Other causes of authentication errors that I have observed have to do with having incorrect time set on the device that you are using. You can also check on that and revert

hmoshfegh commented 4 years ago

thank you for answering and giving time excuse me it was my fault, it solved

Woocommerce woocommerce = Woocommerce.Builder() .setSiteUrl("http://parstuts.ir") .setApiVersion(Woocommerce.API_V2) .setConsumerKey(ConstantValues.WOOCOMMERCE_CONSUMER_KEY) .setConsumerSecret(ConstantValues.WOOCOMMERCE_CONSUMER_KEY) // this line is my fault 😌 .build();

‫‪Gilbert Kimutai‬‏ ‪notifications@github.com‬‏ در تاریخ سه‌شنبه ۳۱ مارس ۲۰۲۰ ساعت ۱۵:۳۹ نوشت:‬

I tried it on my phone and I was able to connect to your website. And the setup here looks fine. Other causes of authentication errors that I have observed have to do with having incorrect time set on the device that you are using. You can also check on that and revert

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gilokimu/WooDroid/issues/19#issuecomment-606559921, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6HAFZN2X2D2H54U6GPOOTRKHFPPANCNFSM4LV57FBA .

gilokimu commented 4 years ago

Ah! I did not notice that as well. Such an easy thing to miss!