cancel
Showing results for 
Search instead for 
Did you mean: 

create php script to reference oauth/initiate indirectly (magento 1.9)

create php script to reference oauth/initiate indirectly (magento 1.9)

Hi together, 

I'm very new to php and magento. 
How do I create php script to reference other script indirectly? 

I got some file in apache2 html directory /var/www/html/magento/app/code/core/Mage/Oauth/Helper/Data.php that is forbiddent to access directly. 

 

$ curl -X POST -H "Authorization: OAuth realm="",oauth_callback="http%3A%2F%2Fmagento.local%2Fapi.php%3Ftype%3Drest%26products%26limit%3D100",oauth_version="1.0",oauth_consumer_key="425f9fd0138f85ef167f310a5ec4f219",oauth_timestamp="1509143057",oauth_nonce="B18CC568585DC84F71EDF3A1C68C3317",oauth_signature_method="HMAC-SHA1",oauth_signature="SdYszI36H+J7zDYGLAr8IRjcQ+U="" "http://magento.local/app/code/core/Mage/Oauth/Helper/Data.php"
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /app/code/core/Mage/Oauth/Helper/Data.php
on this server.<br />
</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at magento.local Port 80</address>
</body></html>

(just in case, it's local web server with test credentials). 

Why I need that file, it's because I am about to pass oauth initiate autorization and found this using grep:

 
$ grep -i "oauth/initiate" /var/www/html/magento/* -R
/var/www/html/magento/app/code/core/Mage/Oauth/Helper/Data.php:    const ENDPOINT_INITIATE                  = 'oauth/initiate';

As a result, it should be a kind of script that will allow me to access oauth/initiate of the /var/www/html/magento/app/code/core/Mage/Oauth/Helper/Data.php file. 

 

The request to http://magento.local/oauth/initiate returns 404 error.


Please advise. 
Thx ahead.

magento ver. 1.9.3.6
php ver. 5.6.32-1
ubuntu 16.04.1 
apache/2.4.18