I've looked at several other SO questions about this same error, but they don't seem to quite match what I'm doing.
I'm working up an AngularJS app & trying to do pagination within JSFiddle. When I click on my link, I get an error: {"error": "Please use POST request"}
Most sources say that I need to simply change my form method. But no where am I using GET or POST, so not sure where the hangup is happening. Even tried setting breakpoints, but that didn't help much.
Help would be appreciated!
note- To get the same error message: you need to select "RUN" & then click on the link
When you first link to the jsfiddle it works because the frame shows http://fiddle.jshell.net/enigmarm/L7CSD/6/show/. When you click RUN it posts the form to http://fiddle.jshell.net/_display/ to render your page. Going to http://fiddle.jshell.net/_display/ in the browser (ie: using GET) will give you the error.
You have an href="" which means that clicking it regets the page using the GET verb instead of the post that created the rendered page. Don't put href="" on that or stop it from requesting the page.
This can happen when using a XSS script-blocker like NoScript, which changes cross-site requests from POST to GET.
Related
I am trying to use react-openidconnect. Its my first touch with OAuth and OpenIdConnect. I did everything as in example (https://www.npmjs.com/package/react-openidconnect) but i have no idea how to redirect to login page provided by Auth Server. I tried to google it, but didn't find anything.
Usually you either redirect as a result of one of these actions:
Clicking a login button
As a result of not having a valid access token and being able to call an API
In both cases you issue an Authorize Redirect by calling userManager.signInRedirect.
See this class for an example.
Out of interest I have some visual tutorials on my blog to explain how to integrate the oidc-client library, which your wrapper library uses.
Initial SPA Code Sample
Write Up
If it helps, my blog also has some more advanced posts and samples, including one in ReactJS.
The JSX that is set in renderNotAuthenticated (so e.g. the <div>You are not authenticated, please click here to authenticate.</div> in the docs) is rendered inside a clickable div element (see the source for details), so you should be redirected with a click on that.
In case you don't get redirected, you should see an error in the browser's console.
I have a link in a basic HTML page:
<a href="http://Overview.html" style="text-decoration:none;" Title="Reports">
<h5>Overview</h5><br>
</a>
The link is actually a blank HTML with a Tableau Viz embedded. When someone has permissions in Tableau it lets them view the page. Otherwise they get an error page "Resource not found Please check the URL and try again."
The error page is a 404 and if this was asp.net I'd know how to handle this. What I need to do is check for the 404 and if exists then redirect to another page (one that actually tells the user they do not have access and to email me to request access).
I'm a newb to JavaScript but I think that is going to be the solution... Could someone show me how to apply JavaScript to redirect to something like "http://denied.html" when 404 exists (what I will make my page)? I have found some examples but am not sure where the script would go inside of my HTML? Inside the link? at top of page (to check the links right away instead of waiting on the link to be clicked)?
The only way to do this would be to add JavaScript (adding an event listener to the link) which:
Cancels the default behaviour of the link
Uses XMLHttpRequest or Fetch to request the URL
Tests the Status to see if it is a 200 OK response and then either:
Sets location to the_link.href or
Sets location to the other URL
The same origin policy will prevent this from working across origins (unless you can get the target origin to support CORS and give you permission).
I'm trying to integrate Amazon's "Login and Pay with Amazon" payment method into my webshop. I followed the steps from the developer docs: http://docs.developer.amazonservices.com/en_UK/apa_guide/APAGuide_GettingStarted.html
The problems starts at the very beginning. I inserted the code for the head part, and also the button widget (explained in Getting Started > Step 1). But when I click the button in my shop, the popup shows the following error:
It says there is a problem with the handling of my order (although I just expected a login screen). And Amazon is about to fix that problem. But I get this error since the very first time I clicked this button, and that's about a week ago. And I can't find any statements to this error.
Is there anything I could have done wrong? I think I setup everything right (client-id, seller-id, return-url, scope- and popup-parameters). Also the onError function isn't called, so I can't really do any debugging.
What causes the error?
Have you setup the Allowed JavaScript Origins in application console? That might cause your problem.
I have created a web site where in one page I select search criteria for mysql.
Depending on the drop-down elements selected, I create a string that I call myquery in a javascript, then I use
window.location.href = "queryMySQL.php?query=" + myquery;
and call a different page.
This works sometimes, but sometimes it gives me the 403 error and the page shows:
You don't have permission to access queryMySQL.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I cannot figure out why it works sometimes and sometimes it does not, the syntax of the query is not a problem, I can get this error even if I remove the code on the page.
Additionally, this worked fine on another web hosting site, but when I copied this implementation on a different site I started having problems.
Suggestions?
EDIT ******************************************************
As I said this has nothing to do with the query. The target page can be a blank html page, and the error is still there. It looks like some security issue on this web hosting site because it worked fine on the other one and on my own server.
Try:
window.location.href = "queryMySQL.php?query=" + encodeURIComponent(myquery);
The query probably contains special characters that need to be encoded in a URL.
So what I am trying to do seems simple enough, but I haven't found a way to do it.
I want to load a webpage that has a post request on it. I would just like to click the submit button using javascript, which submits the form and loads the reply. The button has an id of "buttonSubmit". I can load the webpage (let's say that it is https://www.somepage.com/form.aspx , and I do not have access to the server it runs on).
If I load the page in the browser, enter into the console, and type the following script, it works:
document.getElementById('buttonSubmit').click();
So I need to put that into a webpage that I can run off of my machine, so the page will load the reply to the post request.
I tried to write an html page which has the javacript:
window.location.href='https://www.somepage.com/form.aspx';
document.getElementById('buttonSubmit').click();
However, this code is not going to work, since after the URL changes, it is not going to execute the next line of code.
So next thing I tried was to load the URL in an iframe and try to run the script on it.
However, that doesn't work, per the following page:
Error trying to access a iframe in JavaScript
Whenever I try to access an element inside the iframe I get an error that it is an unsafe operation or that there was an error.
What is the best way to do this? There must be a way to get this to work.
Thank you for your help!