What specifically the meaning of "Error Code 403 ASN mismatch"? - php

I'm trying to create an application that uses the Streamtape API (https://streamtape.com/api#download-getlink) to download a video file. My application run smoothly and perfectly on local development server. However, when I deployed it to live server (AWS), I'm getting a 403 error saying "ASN mismatch / Website: AS14618 Download: AS9299".
I'm trying to figure out the cause of it but no luck. Any idea or fix? I'm using file_get_contents to get te data from JSON response and dynamically add it to link.

https://en.wikipedia.org/wiki/Autonomous_system_(Internet)
TLDR: An ASN identifies a internet network operator. IP address blocks are assigned to ASNs.
This thing seems to be complaining that you're attempting to access it from AS14618 [Amazon] when it is expecting to be accessed from AS9299 [Philippine LDT].
Either you need to get the remote provider to allow access from Amazon, or you need to keep your website inside their approved network.

Related

Shopify: There’s no page at this address Check the URL and try again, or use the search bar to find what you need

I’m new to Shopify App development. I’ve developed an app using a php template provided by shopify. It’s using Laravel & React. It’s https://github.com/Shopify/shopify-app-template-php/tree/cli_three
When I execute npm run dev, the app is running in the development store.
Then, I deployed my app on the AWS server using one domain (e.g: sub.mydomain.com).
Before deployment:
I have build the frontend using: SHOPIFY_API_KEY=MY_API_KEY npm run build
I’ve run composer build too.
After that, I tried to install the app. While doing so, It’s authenticating and saving the session in the database too.
But, on redirecting after authentication, it’s not working,
First, It’s giving this error on console:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://mystore.myshopify.com') does not match the recipient window's origin ('https://sub.mydomain.net').
And then after redirect, it’s displaying:
Along with console error:
GET https://mystore.myshopify.com/admin/apps/40aac89c4c56232219d0f1f75a1f2ae7/?hmac=68236dae6688aafd05925cf409dfff0965236542401999f8ff47decd8b942d&host=cW9kZWFuYWx5dGljcy5JKihgZnkuY29tL2FkbWlu&shop=mystore.myshopify.com&timestamp=1657698129 404
About that console error you need to add this header on top of the page in views top_level.blade.php
<?php
$domain= $shop ?? Auth::user()->name ; ; // loged-in shopify store url example.myshopify.com
header("Content-Security-Policy: frame-ancestors https://".$domain." "."https://admin.shopify.com");
?>
This will resolve the does not match the recipient window's origin error.
After that try to open the app again or you can remove the entry from db and install the app again hope that will help.

Wordpress REST API Issue

I'm currently trying to wrap my head around Wordpress and its relation to the REST API. All of theses issues are only occurring in the context of plugin development. So far I had setup my endpoint and written my callback which will be executed whenever someone is sending a GET-Request to said endpoint. However, my callback is never called. This is the file which I've written so far.
/*
* Plugin Name: cola-learning
*/
if(!defined('ABSPATH')){
die;
}
if(!function_exists('add_action')){
echo 'You cant access this ressource!';
exit;
}
function PrintRESTResponse()
{
return rest_ensure_response("student");
}
function SetupREST()
{
return register_rest_route("student/v1","/view/",[
'methods' => 'GET',
'callback' => 'PrintRESTResponse'
],false);
}
add_action('rest_api_init','SetupREST');
Perhaps it might also help, if I'll give some background information about my development machine:
- OS: Windows 10
- Server: Apache Web Server (included inside XAMPP)
- Wordpress Version: 5.3.2
- PHP Version: 7.4
- Development IDE: Eclipse 2019-12 CDT ( with PHP Plugin )
From my research, everything should work fine. However, it doesnt :/ Did I miss something crucial?
Update:
WordPress REST API Routing
WordPress is having a default route for all request which are directed to the REST API ( at least if you use XAMPP with the Bitnami WordPress application module). Now, if one wants to send a request to said REST API, the person needs to use an URL with the form of ip:port/wp-json/rest_route. ip ressembles the ip address of the server which is hosting wordpress. port is the port of said server. wp-json, however, is the portion which differs an ordinary request from a request to the REST API. Everything after this portion (rest_route) is the rest route which I've defined in the above source code.
What went wrong?
My request was pointed to the wrong endpoint. Therefore I used the URL 'localhost:wpPort/wordpress/student/v1/view/'. However, the 'wp-json/' portion is missing. Therefore WordPress will search for a page that doesn't exist in the first place. Instead I should have used the URL 'localhost:wpPort/wordpress/wp-json/student/v1/view/'.
After some troubleshooting it turns out the URL being used to test was missing a part of the endpoint path.
Here is the correct path to test the newly registered endpoint.
localhost:80/wordpress/wp-json/student/v1/view/
Here's some more reading on WP Rest API endpoints:
https://developer.wordpress.org/rest-api/extending-the-rest-api/routes-and-endpoints/

facebook app can not find my localserver redirected url

I working on third party social login facebook by using django-social-authpackage. But when try to login bellow error show .
I also use django-allauth package and for that i use answerme facebook app.But same problem shown there also.
Facebook server will never find your local server because your website is not live and if you are running localserver then that means that is available to you only and the other person or Machine will not be able to access your server which local. so, to provide your url as callback url you will have to host your local server somewhere globally so, that Facebook can go through that and give results in response to that.
In Settings -> basic set http://localhost:8000/
In Django settings set:
SOCIAL_AUTH_FACEBOOK_KEY = your key
SOCIAL_AUTH_FACEBOOK_SECRET = your secret key
Also in case of success or fail you can redirect the user using this settings.
For finish SOCIAL_AUTH_LOGIN_REDIRECT_URL
For fail SOCIAL_AUTH_LOGIN_URL

when am going to access my magento application in another system within the same network but it's not working

When I'm going to access my magento application in another system within the same network, it's not working. So I have changed the option in admin/store/configuration/web base url as 127.0.0.1
<---error----->
There has been an error processing your request
Invalid URI passed as string (http://127.0.0.1/Magento/admin/http:/index/127.0.0.1/Magento/admin/admin/index/index/key/340b03b40a3bd841fdc1fbfe18d05c3677fb06490f8d39f7842668ea8bd12291/?SID=2tdm2rapk83scle9t276cmlj70/key/2ada0f8216f4ff138e6a556f4f361bfd62bce4d0bcb896f02eab9deb551851a1/&SID=2tdm2rapk83scle9t276cmlj70)
Error log record number: 447387072
<---error end---->
Please provide me some solution.

Testlink integration with redmine (interface:rest) is not working

We have Redmine & Testlink hosted on 2 different servers on Amazon Cloud.
I used below methods / workarounds to establish a connection between these two, however I am getting "Something is preventing to connect to bug tracking system, it will create performance issue..." on Execute Test page of testlink.
Made below configuration in Issue Tracker Management under
Redmine(interface:rest)
<issuetracker>
<apikey>3fe68920f3cf</apikey>
<uribase>https://odessa.sharred.net</uribase>
<uriview>https://odessa.sharred.net/redmine/CM/issues/</uriview> <!-- for Redmine 1.x add show/ -->
<projectidentifier>Common</projectidentifier>
</issuetracker>
Enabled API from redmine.
Made settings in C:\xampp\htdocs\testlink\third_party\redmine-php-api\lib\redmine-rest-api.php for curl_setopt() to allow to use HTTPS.
Tried giving Redmine Base URL using IP ADDRESS instead of Host name.
Do not see any relevant logs in testlink's events section.
Added entry of redmine in config.inc.php with $g_interface_bugs='REDMINE';
Also observed that URL given in URIBASE is opening in web browser with parameter passed as key i.e. https://odessa.sharred.net?key=3fe68920f3cf
is accessible from testlink server.
Any insight / solution on this issue will be great help.
Your configuration should look something like this.
<issuetracker>
<apikey>3fe68920f3cf</apikey>
<uribase>https://ServerIP/redmine</uribase>
<uriview>https://ServerIP/redmine/issues/</uriview>
<projectidentifier>CM</projectidentifier>
</issuetracker>
I also had trouble and just got it working now.
If you still have issue goto http://TLServerIP/testlink/lib/events/eventviewer.php and check the error
Similarly you can go to //redmineinstalldir/apps/redmine/htdocs/log/production.log to see what error you are getting after you click test connection on testlink

Categories