4

THIS IS NOT THE DUPLICATED POST OF What API does the Magento Mobile Store native app use?

Now i want to develop mobile app for this website. So for webservice i have created a custom module. In this module i have a controller called mobileApi. In this mobileApiController i am writing all webservice function. For an example getAllProducts().

Now, on the other hand i want to use magento rest api for access token and Access token secret. If the access to rest api is valid then only my custom controller i.e. mobileApiController will return data.

I want the system to work like this, At the time of App launch mobile app will call a webservice to authenticate the rest api access, and the webservice will return valid access token and Access token secret. After that on every webservice call it will first validate the rest api access, If access is valid then serve then serve the data otherwise shows authentication error.

I have developed everything and all is working fine, but the problem is at the time of App Launch, when i call the service to get access token and access token secret, magento system takes me to a page where it asks for authentication.

Screenshot (step 1) enter image description here After Login it shows me this page.

Screenshot (step 2) enter image description here Then if i authenticate the access then rest api get authenticated and returns access token and access token secret then webservice start serving the data.

But how do I manage this authentication from app? I need to skip these two step (step1 and step2).

I want to call the webservice to get the access token and access token secret at the app launch and right away get the access token and access token secret without these step 1 i.e. login and step 2 authorization.

Thanks in advance.

And my question is different than What API does the Magento Mobile Store native app use?. I have search a lot about this but didn't find any similar. So, don't give me any stack overflow/stack exchange link. No body asked this question earlier.

asked Mar 28, 2015 at 0:18
2
  • 2
    possible duplicate of What API does the Magento Mobile Store native app use? Commented Mar 28, 2015 at 0:32
  • no Keyul, this is different question. he dont know what to use but I know what to use and how to use. If you know how can i skip the above explain two step, just tell me. Commented Mar 28, 2015 at 0:37

1 Answer 1

4

If you want to skip this authentication steps then you can use cUrl to submit those authentication form without clicking on button.

You can use following tutorial for cUrl: http://php.net/manual/en/book.curl.php

My point of view you need to implement these steps in such way that only once you need to create authentication token after that you can reuse it.

You can use rest.js to implment rest api calls from your mobile app. Refer below urls 1. https://github.com/cujojs/rest 2. https://spring.io/guides/gs/consuming-rest-restjs/

Thanks

answered Jul 22, 2015 at 13:08

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.