4

Is there a way to pass login credentials from code instead of entering credentials everytime in the popup for login authorization?

2 Answers 2

1

You dont require login credentials every time for authorization,you'll get an access token and access secret upon successfull authorization by OAuth,use the later for further calls to the API.Oauth protocol works this way.

I guess Magento is using OAuth 1.0/1.0a,so everytime you'll authorize a user you get,

oauth_token - the Access Token that provides access to protected resources.

oauth_token_secret - the secret that is associated with the Access Token.

Sign up to request clarification or add additional context in comments.

10 Comments

Is there any time duration for the validity of the oauth_token and oauth_token_secret ?
I used the oauth_token and oauth_token secret for my further calls it worked fine but moment I cleared all cache and cookies it said access denied for subsequent requests.
mostly for OAuth 1.0/1.0a there is no time duration validity
After clearing the cache and cookies of the browser it said {"messages":{"error":[{"code":403,"message":"Access denied"}]}}, I used the same oauth_token and oauth_token_secret
check the access token is still valid,refer magentocommerce.com/api/rest/authentication/…
|
0

You will need to use OAUTH based authentication. Then pass the request token along with each request:

Refer: http://www.magentocommerce.com/api/rest/authentication/oauth_authentication.html

3 Comments

I am using Magento REST API
I am using Oauth for this, only thing that I wanted was how to pass user credentials to the authorization url so that it does not prompt the user for each request to enter his credentials and then click on authorize.Code url: header('Location: ' . $adminAuthorizationUrl . '?oauth_token=' . $requestToken['oauth_token']);
I know this is old, but did you end up using the php script they have or something else?

Your Answer

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.