8

Developing android native application using scribe library, and uses Rest based web services from existing Magento based eCommerce platform.

I have got prerequisite requirement like 'Key' and 'Secret' from the Magento based Oauth Consumer.

Since,there are three user in existing scenario like, registered customer, admin and guest user.

For registered customer and admin Iam able to get the outh token and secret token after fulfilling the authorization url link and allowing the app to access my account.

But initially I wanted to access the rest services and display product list as a guest user(not registered with application) but each time It ask for authorization url.

I'am sharing part of code snippet please go through it.

OAuthService service = new ServiceBuilder()
                    .provider(MagentoThreeLeggedOAuth.class)
                    .apiKey(MAGENTO_API_KEY)
                    .apiSecret(MAGENTO_API_SECRET)
                    .debug()
                    .build();

Token requestToken = service.getRequestToken();

String authorizationUrl = service.getAuthorizationUrl(requestToken);

/*popup window which displays authorization from the user*/

startActivity(new Intent("android.intent.action.VIEW", Uri.parse(authorizationUrl)));

How to get the secret token for guest user?

Thanks in advance.

  • Which magento you use 1 or 2 ?? Are you develop new api or access magento default apis ? – Deexit Sanghani Jul 22 '17 at 7:31
  • @ Deexit Sanghani using magento-1.8 – Visakh B Sujathan Mar 1 '18 at 11:53
1

Try magento 2 it gives more support to api.it uses rest api and is most suitable for apps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.