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.

Abhishek Tripathi
2,9152 gold badges21 silver badges38 bronze badges
asked Oct 18, 2015 at 14:05
2
  • Which magento you use 1 or 2 ?? Are you develop new api or access magento default apis ? Commented Jul 22, 2017 at 7:31
  • @ Deexit Sanghani using magento-1.8 Commented Mar 1, 2018 at 11:53

1 Answer 1

1

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

answered Feb 23, 2018 at 7:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.